forked from loafle/openapi-generator-original
[csharp][generichost] Modernizes handling of composed schemas (#15865)
* removed hotfixes, improved composed schema handling * fix copy paste bug
This commit is contained in:
parent
389270334a
commit
5555137b79
@ -270,12 +270,6 @@ public class DefaultGenerator implements Generator {
|
||||
InlineModelResolver inlineModelResolver = new InlineModelResolver();
|
||||
inlineModelResolver.setInlineSchemaNameMapping(config.inlineSchemaNameMapping());
|
||||
inlineModelResolver.setInlineSchemaNameDefaults(config.inlineSchemaNameDefault());
|
||||
if (inlineModelResolver.refactorAllOfInlineSchemas == null && // option not set
|
||||
config instanceof CSharpClientCodegen) { // default to true for csharp-netcore generator
|
||||
inlineModelResolver.refactorAllOfInlineSchemas = true;
|
||||
LOGGER.info("inlineModelResolver.refactorAllOfInlineSchemas is default to true instead of false for `csharp-netcore` generator." +
|
||||
"Add --inline-schema-name-defaults REFACTOR_ALLOF_INLINE_SCHEMAS=false in CLI for example to set it to false instead.");
|
||||
}
|
||||
|
||||
inlineModelResolver.flatten(openAPI);
|
||||
}
|
||||
|
@ -495,6 +495,32 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
CodegenModel model = ModelUtils.getModelByName(entry.getKey(), objs);
|
||||
removeCircularReferencesInComposedSchemas(model);
|
||||
|
||||
CodegenComposedSchemas composedSchemas = model.getComposedSchemas();
|
||||
if (composedSchemas != null) {
|
||||
List<CodegenProperty> allOf = composedSchemas.getAllOf();
|
||||
if (allOf != null) {
|
||||
for(CodegenProperty property : allOf) {
|
||||
property.name = patchPropertyName(model, property.baseType);
|
||||
}
|
||||
}
|
||||
|
||||
List<CodegenProperty> anyOf = composedSchemas.getAnyOf();
|
||||
if (anyOf != null) {
|
||||
for(CodegenProperty property : anyOf) {
|
||||
property.name = patchPropertyName(model, property.baseType);
|
||||
property.isNullable = true;
|
||||
}
|
||||
}
|
||||
|
||||
List<CodegenProperty> oneOf = composedSchemas.getOneOf();
|
||||
if (oneOf != null) {
|
||||
for(CodegenProperty property : oneOf) {
|
||||
property.name = patchPropertyName(model, property.baseType);
|
||||
property.isNullable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/OpenAPITools/openapi-generator/issues/12324
|
||||
// TODO: why do these collections contain different instances?
|
||||
// fixing allVars should suffice instead of patching every collection
|
||||
@ -526,7 +552,22 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
return processed;
|
||||
}
|
||||
|
||||
private void patchProperty(Map<String, CodegenModel> enumRefs, CodegenModel model, CodegenProperty property) {
|
||||
private String patchPropertyName(CodegenModel model, String value) {
|
||||
// the casing will be wrong if we just set the name to escapeReservedWord
|
||||
// if we try to fix it with camelize, underscores get stripped out
|
||||
// so test if the name was escaped and then replace var with Var
|
||||
String tmpPropertyName = escapeReservedWord(model, value);
|
||||
if (!value.equals(tmpPropertyName) || value.startsWith(this.invalidNamePrefix)) {
|
||||
value = tmpPropertyName;
|
||||
String firstCharacter = value.substring(0, 1);
|
||||
value = value.substring(1);
|
||||
value = firstCharacter.toUpperCase(Locale.ROOT) + value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
protected void patchProperty(Map<String, CodegenModel> enumRefs, CodegenModel model, CodegenProperty property) {
|
||||
if (enumRefs.containsKey(property.dataType)) {
|
||||
// Handle any enum properties referred to by $ref.
|
||||
// This is different in C# than most other generators, because enums in C# are compiled to integral types,
|
||||
@ -554,15 +595,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
|
||||
String tmpPropertyName = escapeReservedWord(model, property.name);
|
||||
if (!property.name.equals(tmpPropertyName) || property.name.startsWith(this.invalidNamePrefix)) {
|
||||
// the casing will be wrong if we just set the name to escapeReservedWord
|
||||
// if we try to fix it with camelize, underscores get stripped out
|
||||
// so test if the name was escaped and then replace var with Var
|
||||
property.name = tmpPropertyName;
|
||||
String firstCharacter = property.name.substring(0, 1);
|
||||
property.name = property.name.substring(1);
|
||||
property.name = firstCharacter.toUpperCase(Locale.ROOT) + property.name;
|
||||
}
|
||||
property.name = patchPropertyName(model, property.name);
|
||||
|
||||
// fix incorrect data types for maps of maps
|
||||
if (property.datatypeWithEnum.endsWith(", List>") && property.items != null) {
|
||||
|
@ -23,6 +23,7 @@ import io.swagger.v3.oas.models.media.ComposedSchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.mozilla.javascript.optimizer.Codegen;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.model.ModelMap;
|
||||
@ -1520,6 +1521,19 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void patchProperty(Map<String, CodegenModel> enumRefs, CodegenModel model, CodegenProperty property) {
|
||||
super.patchProperty(enumRefs, model, property);
|
||||
|
||||
if (!GENERICHOST.equals(getLibrary()) || model.parentModel == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (model.parentModel.allVars.stream().anyMatch(v -> v.baseName.equals(property.baseName))){
|
||||
property.isInherited = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelsMap postProcessModels(ModelsMap objs) {
|
||||
objs = super.postProcessModels(objs);
|
||||
@ -1564,75 +1578,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
return objs;
|
||||
}
|
||||
|
||||
/**
|
||||
* ISSUE: https://github.com/OpenAPITools/openapi-generator/issues/11846
|
||||
* Ensures that a model has all inherited properties
|
||||
* Check modules\openapi-generator\src\test\resources\3_0\java\petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
* Without this method, property petType in GrandparentAnimal will not make it through ParentPet and into ChildCat
|
||||
*/
|
||||
private void ensureInheritedPropertiesArePresent(CodegenModel derivedModel) {
|
||||
// every c# generator should definitely want this, or we should fix the issue
|
||||
// still, lets avoid breaking changes :(
|
||||
if (Boolean.FALSE.equals(GENERICHOST.equals(getLibrary()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (derivedModel.parentModel == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (CodegenProperty parentProperty : derivedModel.parentModel.allVars) {
|
||||
if (Boolean.FALSE.equals(derivedModel.allVars.stream().anyMatch(v -> v.baseName.equals(parentProperty.baseName)))) {
|
||||
CodegenProperty clone = parentProperty.clone();
|
||||
clone.isInherited = true;
|
||||
LOGGER.debug("Inherited property " + clone.name + " from model" + derivedModel.parentModel.classname + " was not found in " + derivedModel.classname + ". Adding a clone now.");
|
||||
derivedModel.allVars.add(clone);
|
||||
}
|
||||
}
|
||||
|
||||
ensureInheritedPropertiesArePresent(derivedModel.parentModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked by {@link DefaultGenerator} after all models have been post-processed, allowing for a last pass of codegen-specific model cleanup.
|
||||
*
|
||||
* @param objs Current state of codegen object model.
|
||||
* @return An in-place modified state of the codegen object model.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs) {
|
||||
objs = super.postProcessAllModels(objs);
|
||||
|
||||
// other libraries probably want these fixes, but lets avoid breaking changes for now
|
||||
if (Boolean.FALSE.equals(GENERICHOST.equals(getLibrary()))) {
|
||||
return objs;
|
||||
}
|
||||
|
||||
ArrayList<CodegenModel> allModels = new ArrayList<>();
|
||||
for (String key : objs.keySet()) {
|
||||
CodegenModel model = ModelUtils.getModelByName(key, objs);
|
||||
allModels.add(model);
|
||||
}
|
||||
|
||||
for (CodegenModel cm : allModels) {
|
||||
cm.anyOf.forEach(anyOf -> removePropertiesDeclaredInComposedClass(anyOf, allModels, cm));
|
||||
cm.oneOf.forEach(oneOf -> removePropertiesDeclaredInComposedClass(oneOf, allModels, cm));
|
||||
cm.allOf.forEach(allOf -> removePropertiesDeclaredInComposedClass(allOf, allModels, cm));
|
||||
|
||||
if (cm.getComposedSchemas() != null && cm.getComposedSchemas().getAllOf() != null && !cm.getComposedSchemas().getAllOf().isEmpty()) {
|
||||
cm.getComposedSchemas().getAllOf().forEach(allOf -> {
|
||||
if (allOf.dataType.equals(cm.parent)) {
|
||||
allOf.isInherited = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ensureInheritedPropertiesArePresent(cm);
|
||||
}
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the property being passed is a C# value type
|
||||
*
|
||||
@ -1647,30 +1592,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
: this.getValueTypes().contains(var.dataType) || var.isEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes properties from a model which are also defined in a composed class.
|
||||
*
|
||||
* @param className The name which may be a composed model
|
||||
* @param allModels A collection of all CodegenModel
|
||||
* @param cm The CodegenModel to correct
|
||||
*/
|
||||
private void removePropertiesDeclaredInComposedClass(String className, List<CodegenModel> allModels, CodegenModel cm) {
|
||||
CodegenModel otherModel = allModels.stream().filter(m -> m.classname.equals(className)).findFirst().orElse(null);
|
||||
if (otherModel == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
otherModel.readWriteVars.stream().filter(v -> cm.readWriteVars.stream().anyMatch(cmV -> cmV.baseName.equals(v.baseName))).collect(Collectors.toList())
|
||||
.forEach(v -> {
|
||||
cm.readWriteVars.removeIf(item -> item.baseName.equals(v.baseName));
|
||||
cm.vars.removeIf(item -> item.baseName.equals(v.baseName));
|
||||
cm.readOnlyVars.removeIf(item -> item.baseName.equals(v.baseName));
|
||||
cm.requiredVars.removeIf(item -> item.baseName.equals(v.baseName));
|
||||
cm.allVars.removeIf(item -> item.baseName.equals(v.baseName));
|
||||
cm.nonNullableVars.removeIf(item -> item.baseName.equals(v.baseName));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcess() {
|
||||
System.out.println("################################################################################");
|
||||
|
@ -38,18 +38,11 @@
|
||||
|
||||
{{#composedSchemas.anyOf}}
|
||||
{{^vendorExtensions.x-duplicated-data-type}}
|
||||
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
||||
Utf8JsonReader {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||
bool {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}});
|
||||
|
||||
{{/vendorExtensions.x-duplicated-data-type}}
|
||||
{{/composedSchemas.anyOf}}
|
||||
{{#composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||
bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref utf8JsonReader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}});
|
||||
|
||||
{{/isInherited}}
|
||||
{{/composedSchemas.allOf}}
|
||||
{{#allVars}}
|
||||
{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{#nrt}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/nrt}}{{^nrt}}{{{datatypeWithEnum}}}{{#vendorExtensions.x-csharp-value-type}}?{{/vendorExtensions.x-csharp-value-type}}{{/nrt}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = default;
|
||||
{{#-last}}
|
||||
@ -182,9 +175,9 @@
|
||||
{{/allVars}}
|
||||
{{#composedSchemas.oneOf}}
|
||||
{{^vendorExtensions.x-duplicated-data-type}}
|
||||
Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}))
|
||||
return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/allVars}}{{/lambda.joinWithComma}});
|
||||
Utf8JsonReader {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Reader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}))
|
||||
return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/allVars}}{{/lambda.joinWithComma}});
|
||||
|
||||
{{/vendorExtensions.x-duplicated-data-type}}
|
||||
{{#-last}}
|
||||
@ -192,14 +185,7 @@
|
||||
{{/-last}}
|
||||
{{/composedSchemas.oneOf}}
|
||||
{{^composedSchemas.oneOf}}
|
||||
{{#model.composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
if ({{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} == null)
|
||||
throw new ArgumentNullException(nameof({{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}), "Property is required for class {{classname}}.");
|
||||
|
||||
{{/isInherited}}
|
||||
{{/model.composedSchemas.allOf}}
|
||||
return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/allVars}}{{/lambda.joinWithComma}});
|
||||
return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/allVars}}{{/lambda.joinWithComma}});
|
||||
{{/composedSchemas.oneOf}}
|
||||
}
|
||||
|
||||
@ -215,23 +201,16 @@
|
||||
{{#lambda.trimLineBreaks}}
|
||||
{{#composedSchemas.anyOf}}
|
||||
{{^vendorExtensions.x-duplicated-data-type}}
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}, jsonSerializerOptions);
|
||||
|
||||
{{/vendorExtensions.x-duplicated-data-type}}
|
||||
{{/composedSchemas.anyOf}}
|
||||
{{#composedSchemas.oneOf}}
|
||||
{{^vendorExtensions.x-duplicated-data-type}}
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}, jsonSerializerOptions);
|
||||
|
||||
{{/vendorExtensions.x-duplicated-data-type}}
|
||||
{{/composedSchemas.oneOf}}
|
||||
{{#composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}, jsonSerializerOptions);
|
||||
|
||||
{{/isInherited}}
|
||||
{{/composedSchemas.allOf}}
|
||||
{{^composedSchemas}}
|
||||
writer.WriteStartObject();
|
||||
|
||||
{{#allVars}}
|
||||
@ -395,7 +374,6 @@
|
||||
{{/allVars}}
|
||||
|
||||
writer.WriteEndObject();
|
||||
{{/composedSchemas}}
|
||||
{{/lambda.trimLineBreaks}}
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
{{#parentModel.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/isInherited}}{{/parentModel.composedSchemas.allOf}}{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/allVars}}
|
||||
{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/allVars}}
|
@ -8,28 +8,20 @@
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="{{classname}}" /> class.
|
||||
/// </summary>
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{#isNullable}}{{nrt?}}{{/isNullable}}"></param>
|
||||
{{#composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}"></param>
|
||||
{{/isInherited}}
|
||||
{{/composedSchemas.allOf}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{/lambda.camelcase_param}}"></param>
|
||||
{{#composedSchemas.anyOf}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{#isNullable}}{{nrt?}}{{/isNullable}}"></param>
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{/lambda.camelcase_param}}"></param>
|
||||
{{/composedSchemas.anyOf}}
|
||||
{{#allVars}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}">{{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}</param>
|
||||
{{/allVars}}
|
||||
[JsonConstructor]
|
||||
{{#readWriteVars}}{{#-first}}public{{/-first}}{{/readWriteVars}}{{^readWriteVars}}internal{{/readWriteVars}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}}
|
||||
{{#readWriteVars}}{{#-first}}public{{/-first}}{{/readWriteVars}}{{^readWriteVars}}internal{{/readWriteVars}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.is-value-type}}?{{/vendorExtensions.is-value-type}}{{/nrt}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{#model.composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}}
|
||||
{
|
||||
{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}};
|
||||
{{#composedSchemas.allOf}}
|
||||
{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}};
|
||||
{{/composedSchemas.allOf}}
|
||||
{{#composedSchemas.anyOf}}
|
||||
{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}};
|
||||
{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{/lambda.camelcase_param}};
|
||||
{{/composedSchemas.anyOf}}
|
||||
{{name}} = {{#lambda.camelcase_param}}{{baseType}}{{/lambda.camelcase_param}};
|
||||
{{#allVars}}
|
||||
{{^isInherited}}
|
||||
{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
|
||||
@ -49,27 +41,17 @@
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="{{classname}}" /> class.
|
||||
/// </summary>
|
||||
{{#composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}"></param>
|
||||
{{/isInherited}}
|
||||
{{/composedSchemas.allOf}}
|
||||
{{#composedSchemas.anyOf}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{#isNullable}}{{nrt?}}{{/isNullable}}"></param>
|
||||
/// <param name="{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}"></param>
|
||||
{{/composedSchemas.anyOf}}
|
||||
{{#allVars}}
|
||||
/// <param name="{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}">{{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}</param>
|
||||
{{/allVars}}
|
||||
[JsonConstructor]
|
||||
{{#readWriteVars}}{{#-first}}public{{/-first}}{{/readWriteVars}}{{^readWriteVars}}internal{{/readWriteVars}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/composedSchemas.allOf}}{{#composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}}
|
||||
{{#readWriteVars}}{{#-first}}public{{/-first}}{{/readWriteVars}}{{^readWriteVars}}internal{{/readWriteVars}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{{name}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}}
|
||||
{
|
||||
{{#composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}};
|
||||
{{/isInherited}}
|
||||
{{/composedSchemas.allOf}}
|
||||
{{#composedSchemas.anyOf}}
|
||||
{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}};
|
||||
{{#lambda.titlecase}}{{name}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.titlecase}}{{name}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}};
|
||||
{{/composedSchemas.anyOf}}
|
||||
{{#allVars}}
|
||||
{{^isInherited}}
|
||||
@ -137,7 +119,7 @@
|
||||
{{#composedSchemas.oneOf}}
|
||||
{{^vendorExtensions.x-duplicated-data-type}}
|
||||
/// <summary>
|
||||
/// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}}
|
||||
/// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}}
|
||||
/// </summary>{{#description}}
|
||||
/// <value>{{.}}</value>{{/description}}
|
||||
{{#example}}
|
||||
@ -146,26 +128,10 @@
|
||||
{{#deprecated}}
|
||||
[Obsolete]
|
||||
{{/deprecated}}
|
||||
public {{{dataType}}}{{nrt?}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}}
|
||||
public {{{dataType}}}{{nrt?}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}}
|
||||
|
||||
{{/vendorExtensions.x-duplicated-data-type}}
|
||||
{{/composedSchemas.oneOf}}
|
||||
{{#composedSchemas.allOf}}
|
||||
{{^isInherited}}
|
||||
/// <summary>
|
||||
/// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}}
|
||||
/// </summary>{{#description}}
|
||||
/// <value>{{.}}</value>{{/description}}
|
||||
{{#example}}
|
||||
/// <example>{{.}}</example>
|
||||
{{/example}}
|
||||
{{#deprecated}}
|
||||
[Obsolete]
|
||||
{{/deprecated}}
|
||||
public {{{dataType}}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}}
|
||||
|
||||
{{/isInherited}}
|
||||
{{/composedSchemas.allOf}}
|
||||
{{#allVars}}
|
||||
{{^isEnum}}
|
||||
{{#isInherited}}
|
||||
|
@ -19,10 +19,8 @@ docs/BananaReq.md
|
||||
docs/BasquePig.md
|
||||
docs/Capitalization.md
|
||||
docs/Cat.md
|
||||
docs/CatAllOf.md
|
||||
docs/Category.md
|
||||
docs/ChildCat.md
|
||||
docs/ChildCatAllOf.md
|
||||
docs/ClassModel.md
|
||||
docs/ComplexQuadrilateral.md
|
||||
docs/DanishPig.md
|
||||
@ -30,7 +28,6 @@ docs/DateOnlyClass.md
|
||||
docs/DefaultApi.md
|
||||
docs/DeprecatedObject.md
|
||||
docs/Dog.md
|
||||
docs/DogAllOf.md
|
||||
docs/Drawing.md
|
||||
docs/EnumArrays.md
|
||||
docs/EnumClass.md
|
||||
@ -142,17 +139,14 @@ src/Org.OpenAPITools/Model/BananaReq.cs
|
||||
src/Org.OpenAPITools/Model/BasquePig.cs
|
||||
src/Org.OpenAPITools/Model/Capitalization.cs
|
||||
src/Org.OpenAPITools/Model/Cat.cs
|
||||
src/Org.OpenAPITools/Model/CatAllOf.cs
|
||||
src/Org.OpenAPITools/Model/Category.cs
|
||||
src/Org.OpenAPITools/Model/ChildCat.cs
|
||||
src/Org.OpenAPITools/Model/ChildCatAllOf.cs
|
||||
src/Org.OpenAPITools/Model/ClassModel.cs
|
||||
src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs
|
||||
src/Org.OpenAPITools/Model/DanishPig.cs
|
||||
src/Org.OpenAPITools/Model/DateOnlyClass.cs
|
||||
src/Org.OpenAPITools/Model/DeprecatedObject.cs
|
||||
src/Org.OpenAPITools/Model/Dog.cs
|
||||
src/Org.OpenAPITools/Model/DogAllOf.cs
|
||||
src/Org.OpenAPITools/Model/Drawing.cs
|
||||
src/Org.OpenAPITools/Model/EnumArrays.cs
|
||||
src/Org.OpenAPITools/Model/EnumClass.cs
|
||||
|
@ -164,17 +164,14 @@ Class | Method | HTTP request | Description
|
||||
- [Model.BasquePig](docs/BasquePig.md)
|
||||
- [Model.Capitalization](docs/Capitalization.md)
|
||||
- [Model.Cat](docs/Cat.md)
|
||||
- [Model.CatAllOf](docs/CatAllOf.md)
|
||||
- [Model.Category](docs/Category.md)
|
||||
- [Model.ChildCat](docs/ChildCat.md)
|
||||
- [Model.ChildCatAllOf](docs/ChildCatAllOf.md)
|
||||
- [Model.ClassModel](docs/ClassModel.md)
|
||||
- [Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
|
||||
- [Model.DanishPig](docs/DanishPig.md)
|
||||
- [Model.DateOnlyClass](docs/DateOnlyClass.md)
|
||||
- [Model.DeprecatedObject](docs/DeprecatedObject.md)
|
||||
- [Model.Dog](docs/Dog.md)
|
||||
- [Model.DogAllOf](docs/DogAllOf.md)
|
||||
- [Model.Drawing](docs/Drawing.md)
|
||||
- [Model.EnumArrays](docs/EnumArrays.md)
|
||||
- [Model.EnumClass](docs/EnumClass.md)
|
||||
|
@ -1393,12 +1393,18 @@ components:
|
||||
Dog:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Animal'
|
||||
- $ref: '#/components/schemas/Dog_allOf'
|
||||
- properties:
|
||||
breed:
|
||||
type: string
|
||||
type: object
|
||||
Cat:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Animal'
|
||||
- $ref: '#/components/schemas/Address'
|
||||
- $ref: '#/components/schemas/Cat_allOf'
|
||||
- properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
type: object
|
||||
Address:
|
||||
additionalProperties:
|
||||
type: integer
|
||||
@ -2103,7 +2109,16 @@ components:
|
||||
ChildCat:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/ParentPet'
|
||||
- $ref: '#/components/schemas/ChildCat_allOf'
|
||||
- properties:
|
||||
name:
|
||||
type: string
|
||||
pet_type:
|
||||
default: ChildCat
|
||||
enum:
|
||||
- ChildCat
|
||||
type: string
|
||||
x-enum-as-string: true
|
||||
type: object
|
||||
ArrayOfEnums:
|
||||
items:
|
||||
$ref: '#/components/schemas/OuterEnum'
|
||||
@ -2364,40 +2379,14 @@ components:
|
||||
required:
|
||||
- requiredFile
|
||||
type: object
|
||||
getCountry_request_allOf:
|
||||
properties:
|
||||
country:
|
||||
type: string
|
||||
required:
|
||||
- country
|
||||
type: object
|
||||
getCountry_request:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/getCountry_request_allOf'
|
||||
Dog_allOf:
|
||||
properties:
|
||||
breed:
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
Cat_allOf:
|
||||
properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
type: object
|
||||
example: null
|
||||
ChildCat_allOf:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
pet_type:
|
||||
default: ChildCat
|
||||
enum:
|
||||
- ChildCat
|
||||
type: string
|
||||
x-enum-as-string: true
|
||||
type: object
|
||||
example: null
|
||||
- properties:
|
||||
country:
|
||||
type: string
|
||||
required:
|
||||
- country
|
||||
type: object
|
||||
securitySchemes:
|
||||
petstore_auth:
|
||||
flows:
|
||||
|
@ -25,17 +25,14 @@ docs/models/BananaReq.md
|
||||
docs/models/BasquePig.md
|
||||
docs/models/Capitalization.md
|
||||
docs/models/Cat.md
|
||||
docs/models/CatAllOf.md
|
||||
docs/models/Category.md
|
||||
docs/models/ChildCat.md
|
||||
docs/models/ChildCatAllOf.md
|
||||
docs/models/ClassModel.md
|
||||
docs/models/ComplexQuadrilateral.md
|
||||
docs/models/DanishPig.md
|
||||
docs/models/DateOnlyClass.md
|
||||
docs/models/DeprecatedObject.md
|
||||
docs/models/Dog.md
|
||||
docs/models/DogAllOf.md
|
||||
docs/models/Drawing.md
|
||||
docs/models/EnumArrays.md
|
||||
docs/models/EnumClass.md
|
||||
@ -148,17 +145,14 @@ src/Org.OpenAPITools/Model/BananaReq.cs
|
||||
src/Org.OpenAPITools/Model/BasquePig.cs
|
||||
src/Org.OpenAPITools/Model/Capitalization.cs
|
||||
src/Org.OpenAPITools/Model/Cat.cs
|
||||
src/Org.OpenAPITools/Model/CatAllOf.cs
|
||||
src/Org.OpenAPITools/Model/Category.cs
|
||||
src/Org.OpenAPITools/Model/ChildCat.cs
|
||||
src/Org.OpenAPITools/Model/ChildCatAllOf.cs
|
||||
src/Org.OpenAPITools/Model/ClassModel.cs
|
||||
src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs
|
||||
src/Org.OpenAPITools/Model/DanishPig.cs
|
||||
src/Org.OpenAPITools/Model/DateOnlyClass.cs
|
||||
src/Org.OpenAPITools/Model/DeprecatedObject.cs
|
||||
src/Org.OpenAPITools/Model/Dog.cs
|
||||
src/Org.OpenAPITools/Model/DogAllOf.cs
|
||||
src/Org.OpenAPITools/Model/Drawing.cs
|
||||
src/Org.OpenAPITools/Model/EnumArrays.cs
|
||||
src/Org.OpenAPITools/Model/EnumClass.cs
|
||||
|
@ -1393,12 +1393,18 @@ components:
|
||||
Dog:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Animal'
|
||||
- $ref: '#/components/schemas/Dog_allOf'
|
||||
- properties:
|
||||
breed:
|
||||
type: string
|
||||
type: object
|
||||
Cat:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Animal'
|
||||
- $ref: '#/components/schemas/Address'
|
||||
- $ref: '#/components/schemas/Cat_allOf'
|
||||
- properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
type: object
|
||||
Address:
|
||||
additionalProperties:
|
||||
type: integer
|
||||
@ -2103,7 +2109,16 @@ components:
|
||||
ChildCat:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/ParentPet'
|
||||
- $ref: '#/components/schemas/ChildCat_allOf'
|
||||
- properties:
|
||||
name:
|
||||
type: string
|
||||
pet_type:
|
||||
default: ChildCat
|
||||
enum:
|
||||
- ChildCat
|
||||
type: string
|
||||
x-enum-as-string: true
|
||||
type: object
|
||||
ArrayOfEnums:
|
||||
items:
|
||||
$ref: '#/components/schemas/OuterEnum'
|
||||
@ -2364,40 +2379,14 @@ components:
|
||||
required:
|
||||
- requiredFile
|
||||
type: object
|
||||
getCountry_request_allOf:
|
||||
properties:
|
||||
country:
|
||||
type: string
|
||||
required:
|
||||
- country
|
||||
type: object
|
||||
getCountry_request:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/getCountry_request_allOf'
|
||||
Dog_allOf:
|
||||
properties:
|
||||
breed:
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
Cat_allOf:
|
||||
properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
type: object
|
||||
example: null
|
||||
ChildCat_allOf:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
pet_type:
|
||||
default: ChildCat
|
||||
enum:
|
||||
- ChildCat
|
||||
type: string
|
||||
x-enum-as-string: true
|
||||
type: object
|
||||
example: null
|
||||
- properties:
|
||||
country:
|
||||
type: string
|
||||
required:
|
||||
- country
|
||||
type: object
|
||||
securitySchemes:
|
||||
petstore_auth:
|
||||
flows:
|
||||
|
@ -6,6 +6,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**Color** | **string** | | [optional] [default to "red"]
|
||||
**Declawed** | **bool** | | [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)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Name** | **string** | | [optional]
|
||||
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -6,6 +6,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**Color** | **string** | | [optional] [default to "red"]
|
||||
**Breed** | **string** | | [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)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Color** | **string** | | [optional]
|
||||
**Cultivar** | **string** | | [optional]
|
||||
**LengthCm** | **decimal** | | [optional]
|
||||
**Origin** | **string** | | [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)
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Cultivar** | **string** | |
|
||||
**LengthCm** | **decimal** | |
|
||||
**Mealy** | **bool** | | [optional]
|
||||
**Sweet** | **bool** | | [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)
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Color** | **string** | | [optional]
|
||||
**Cultivar** | **string** | | [optional]
|
||||
**LengthCm** | **decimal** | | [optional]
|
||||
**Origin** | **string** | | [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)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**HasBaleen** | **bool** | | [optional]
|
||||
**HasTeeth** | **bool** | | [optional]
|
||||
**Type** | **string** | | [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)
|
||||
|
||||
|
@ -5,6 +5,8 @@ The value may be a shape or the 'null' value. The 'nullable' attribute was intro
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -6,6 +6,7 @@ The value may be a shape or the 'null' value. This is introduced in OAS schema >
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -52,5 +52,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Cat
|
||||
//Assert.IsType<Cat>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Declawed'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DeclawedTest()
|
||||
{
|
||||
// TODO unit test for the property 'Declawed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" ChildCat
|
||||
//Assert.IsType<ChildCat>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'PetType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PetTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'PetType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" ComplexQuadrilateral
|
||||
//Assert.IsType<ComplexQuadrilateral>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Dog
|
||||
//Assert.IsType<Dog>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Breed'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BreedTest()
|
||||
{
|
||||
// TODO unit test for the property 'Breed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" EquilateralTriangle
|
||||
//Assert.IsType<EquilateralTriangle>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,41 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" FruitReq
|
||||
//Assert.IsType<FruitReq>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Mealy'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MealyTest()
|
||||
{
|
||||
// TODO unit test for the property 'Mealy'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Sweet'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SweetTest()
|
||||
{
|
||||
// TODO unit test for the property 'Sweet'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,32 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Origin'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OriginTest()
|
||||
{
|
||||
// TODO unit test for the property 'Origin'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,32 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Origin'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OriginTest()
|
||||
{
|
||||
// TODO unit test for the property 'Origin'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" IsoscelesTriangle
|
||||
//Assert.IsType<IsoscelesTriangle>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,41 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Mammal
|
||||
//Assert.IsType<Mammal>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'HasBaleen'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HasBaleenTest()
|
||||
{
|
||||
// TODO unit test for the property 'HasBaleen'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'HasTeeth'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HasTeethTest()
|
||||
{
|
||||
// TODO unit test for the property 'HasTeeth'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Type'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" NullableShape
|
||||
//Assert.IsType<NullableShape>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Pig
|
||||
//Assert.IsType<Pig>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Quadrilateral
|
||||
//Assert.IsType<Quadrilateral>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" ScaleneTriangle
|
||||
//Assert.IsType<ScaleneTriangle>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" SimpleQuadrilateral
|
||||
//Assert.IsType<SimpleQuadrilateral>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,8 +130,8 @@ namespace Org.OpenAPITools.Client
|
||||
return boolean
|
||||
? "true"
|
||||
: "false";
|
||||
if (obj is ChildCatAllOf.PetTypeEnum childCatAllOfPetTypeEnum)
|
||||
return ChildCatAllOf.PetTypeEnumToJsonValue(childCatAllOfPetTypeEnum);
|
||||
if (obj is ChildCat.PetTypeEnum childCatPetTypeEnum)
|
||||
return ChildCat.PetTypeEnumToJsonValue(childCatPetTypeEnum);
|
||||
if (obj is EnumArrays.ArrayEnumEnum enumArraysArrayEnumEnum)
|
||||
return EnumArrays.ArrayEnumEnumToJsonValue(enumArraysArrayEnumEnum);
|
||||
if (obj is EnumArrays.JustSymbolEnum enumArraysJustSymbolEnum)
|
||||
@ -148,6 +148,8 @@ namespace Org.OpenAPITools.Client
|
||||
return EnumTest.EnumStringEnumToJsonValue(enumTestEnumStringEnum);
|
||||
if (obj is EnumTest.EnumStringRequiredEnum enumTestEnumStringRequiredEnum)
|
||||
return EnumTest.EnumStringRequiredEnumToJsonValue(enumTestEnumStringRequiredEnum);
|
||||
if (obj is Mammal.TypeEnum mammalTypeEnum)
|
||||
return Mammal.TypeEnumToJsonValue(mammalTypeEnum);
|
||||
if (obj is MapTest.InnerEnum mapTestInnerEnum)
|
||||
return MapTest.InnerEnumToJsonValue(mapTestInnerEnum);
|
||||
if (obj is Order.StatusEnum orderStatusEnum)
|
||||
|
@ -57,17 +57,14 @@ namespace Org.OpenAPITools.Client
|
||||
_jsonOptions.Converters.Add(new BasquePigJsonConverter());
|
||||
_jsonOptions.Converters.Add(new CapitalizationJsonConverter());
|
||||
_jsonOptions.Converters.Add(new CatJsonConverter());
|
||||
_jsonOptions.Converters.Add(new CatAllOfJsonConverter());
|
||||
_jsonOptions.Converters.Add(new CategoryJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ChildCatJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ChildCatAllOfJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ClassModelJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ComplexQuadrilateralJsonConverter());
|
||||
_jsonOptions.Converters.Add(new DanishPigJsonConverter());
|
||||
_jsonOptions.Converters.Add(new DateOnlyClassJsonConverter());
|
||||
_jsonOptions.Converters.Add(new DeprecatedObjectJsonConverter());
|
||||
_jsonOptions.Converters.Add(new DogJsonConverter());
|
||||
_jsonOptions.Converters.Add(new DogAllOfJsonConverter());
|
||||
_jsonOptions.Converters.Add(new DrawingJsonConverter());
|
||||
_jsonOptions.Converters.Add(new EnumArraysJsonConverter());
|
||||
_jsonOptions.Converters.Add(new EnumClassConverter());
|
||||
|
@ -33,29 +33,23 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Cat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dictionary"></param>
|
||||
/// <param name="catAllOf"></param>
|
||||
/// <param name="className">className</param>
|
||||
/// <param name="declawed">declawed</param>
|
||||
/// <param name="color">color (default to "red")</param>
|
||||
[JsonConstructor]
|
||||
internal Cat(Dictionary<string, int> dictionary, CatAllOf catAllOf, string className, string color = @"red") : base(className, color)
|
||||
public Cat(string className, bool declawed, string color = @"red") : base(className, color)
|
||||
{
|
||||
Dictionary = dictionary;
|
||||
CatAllOf = catAllOf;
|
||||
Declawed = declawed;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Dictionary
|
||||
/// Gets or Sets Declawed
|
||||
/// </summary>
|
||||
public Dictionary<string, int> Dictionary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets CatAllOf
|
||||
/// </summary>
|
||||
public CatAllOf CatAllOf { get; set; }
|
||||
[JsonPropertyName("declawed")]
|
||||
public bool Declawed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@ -66,6 +60,7 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Cat {\n");
|
||||
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" Declawed: ").Append(Declawed).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -93,13 +88,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader dictionaryReader = utf8JsonReader;
|
||||
bool dictionaryDeserialized = Client.ClientUtils.TryDeserialize<Dictionary<string, int>>(ref utf8JsonReader, jsonSerializerOptions, out Dictionary<string, int>? dictionary);
|
||||
|
||||
Utf8JsonReader catAllOfReader = utf8JsonReader;
|
||||
bool catAllOfDeserialized = Client.ClientUtils.TryDeserialize<CatAllOf>(ref utf8JsonReader, jsonSerializerOptions, out CatAllOf? catAllOf);
|
||||
|
||||
string? className = default;
|
||||
bool? declawed = default;
|
||||
string? color = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
@ -120,6 +110,10 @@ namespace Org.OpenAPITools.Model
|
||||
case "className":
|
||||
className = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "declawed":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
declawed = utf8JsonReader.GetBoolean();
|
||||
break;
|
||||
case "color":
|
||||
color = utf8JsonReader.GetString();
|
||||
break;
|
||||
@ -132,16 +126,13 @@ namespace Org.OpenAPITools.Model
|
||||
if (className == null)
|
||||
throw new ArgumentNullException(nameof(className), "Property is required for class Cat.");
|
||||
|
||||
if (declawed == null)
|
||||
throw new ArgumentNullException(nameof(declawed), "Property is required for class Cat.");
|
||||
|
||||
if (color == null)
|
||||
throw new ArgumentNullException(nameof(color), "Property is required for class Cat.");
|
||||
|
||||
if (dictionary == null)
|
||||
throw new ArgumentNullException(nameof(dictionary), "Property is required for class Cat.");
|
||||
|
||||
if (catAllOf == null)
|
||||
throw new ArgumentNullException(nameof(catAllOf), "Property is required for class Cat.");
|
||||
|
||||
return new Cat(dictionary, catAllOf, className, color);
|
||||
return new Cat(className, declawed.Value, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -153,10 +144,13 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, cat.Dictionary, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, cat.CatAllOf, jsonSerializerOptions);
|
||||
writer.WriteString("className", cat.ClassName);
|
||||
writer.WriteBoolean("declawed", cat.Declawed);
|
||||
writer.WriteString("color", cat.Color);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,21 +33,81 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChildCat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="childCatAllOf"></param>
|
||||
/// <param name="petType">petType</param>
|
||||
/// <param name="name">name</param>
|
||||
/// <param name="petType">petType (default to PetTypeEnum.ChildCat)</param>
|
||||
[JsonConstructor]
|
||||
internal ChildCat(ChildCatAllOf childCatAllOf, string petType) : base(petType)
|
||||
public ChildCat(string name, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType))
|
||||
{
|
||||
ChildCatAllOf = childCatAllOf;
|
||||
Name = name;
|
||||
PetType = petType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ChildCatAllOf
|
||||
/// Defines PetType
|
||||
/// </summary>
|
||||
public ChildCatAllOf ChildCatAllOf { get; set; }
|
||||
public enum PetTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum ChildCat for value: ChildCat
|
||||
/// </summary>
|
||||
ChildCat = 1
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="PetTypeEnum"/>
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static PetTypeEnum PetTypeEnumFromString(string value)
|
||||
{
|
||||
if (value == "ChildCat")
|
||||
return PetTypeEnum.ChildCat;
|
||||
|
||||
throw new NotImplementedException($"Could not convert value to type PetTypeEnum: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="PetTypeEnum"/>
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static PetTypeEnum? PetTypeEnumFromStringOrDefault(string value)
|
||||
{
|
||||
if (value == "ChildCat")
|
||||
return PetTypeEnum.ChildCat;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the <see cref="PetTypeEnum"/> to the json value
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static string PetTypeEnumToJsonValue(PetTypeEnum value)
|
||||
{
|
||||
if (value == PetTypeEnum.ChildCat)
|
||||
return "ChildCat";
|
||||
|
||||
throw new NotImplementedException($"Value could not be handled: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PetType
|
||||
/// </summary>
|
||||
[JsonPropertyName("pet_type")]
|
||||
public new PetTypeEnum PetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@ -58,6 +118,8 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class ChildCat {\n");
|
||||
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" PetType: ").Append(PetType).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -85,10 +147,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader childCatAllOfReader = utf8JsonReader;
|
||||
bool childCatAllOfDeserialized = Client.ClientUtils.TryDeserialize<ChildCatAllOf>(ref utf8JsonReader, jsonSerializerOptions, out ChildCatAllOf? childCatAllOf);
|
||||
|
||||
string? petType = default;
|
||||
string? name = default;
|
||||
ChildCat.PetTypeEnum? petType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -105,8 +165,14 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "name":
|
||||
name = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "pet_type":
|
||||
petType = utf8JsonReader.GetString();
|
||||
string? petTypeRawValue = utf8JsonReader.GetString();
|
||||
petType = petTypeRawValue == null
|
||||
? null
|
||||
: ChildCat.PetTypeEnumFromStringOrDefault(petTypeRawValue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -114,13 +180,13 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
if (name == null)
|
||||
throw new ArgumentNullException(nameof(name), "Property is required for class ChildCat.");
|
||||
|
||||
if (petType == null)
|
||||
throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCat.");
|
||||
|
||||
if (childCatAllOf == null)
|
||||
throw new ArgumentNullException(nameof(childCatAllOf), "Property is required for class ChildCat.");
|
||||
|
||||
return new ChildCat(childCatAllOf, petType);
|
||||
return new ChildCat(name, petType.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -132,8 +198,17 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, childCat.ChildCatAllOf, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("name", childCat.Name);
|
||||
|
||||
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType);
|
||||
if (petTypeRawValue != null)
|
||||
writer.WriteString("pet_type", petTypeRawValue);
|
||||
else
|
||||
writer.WriteNull("pet_type");
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,27 +33,29 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ComplexQuadrilateral" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeInterface"></param>
|
||||
/// <param name="quadrilateralInterface"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
[JsonConstructor]
|
||||
internal ComplexQuadrilateral(ShapeInterface shapeInterface, QuadrilateralInterface quadrilateralInterface)
|
||||
public ComplexQuadrilateral(string quadrilateralType, string shapeType)
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
QuadrilateralInterface = quadrilateralInterface;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// Gets or Sets QuadrilateralType
|
||||
/// </summary>
|
||||
public ShapeInterface ShapeInterface { get; set; }
|
||||
[JsonPropertyName("quadrilateralType")]
|
||||
public string QuadrilateralType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets QuadrilateralInterface
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
public QuadrilateralInterface QuadrilateralInterface { get; set; }
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
@ -69,6 +71,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class ComplexQuadrilateral {\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -107,11 +111,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||
|
||||
Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader;
|
||||
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface? quadrilateralInterface);
|
||||
string? quadrilateralType = default;
|
||||
string? shapeType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -128,19 +129,25 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "quadrilateralType":
|
||||
quadrilateralType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shapeInterface == null)
|
||||
throw new ArgumentNullException(nameof(shapeInterface), "Property is required for class ComplexQuadrilateral.");
|
||||
if (quadrilateralType == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ComplexQuadrilateral.");
|
||||
|
||||
if (quadrilateralInterface == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralInterface), "Property is required for class ComplexQuadrilateral.");
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class ComplexQuadrilateral.");
|
||||
|
||||
return new ComplexQuadrilateral(shapeInterface, quadrilateralInterface);
|
||||
return new ComplexQuadrilateral(quadrilateralType, shapeType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -152,10 +159,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, complexQuadrilateral.ShapeInterface, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, complexQuadrilateral.QuadrilateralInterface, jsonSerializerOptions);
|
||||
writer.WriteString("quadrilateralType", complexQuadrilateral.QuadrilateralType);
|
||||
writer.WriteString("shapeType", complexQuadrilateral.ShapeType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,22 +33,23 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Dog" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dogAllOf"></param>
|
||||
/// <param name="breed">breed</param>
|
||||
/// <param name="className">className</param>
|
||||
/// <param name="color">color (default to "red")</param>
|
||||
[JsonConstructor]
|
||||
internal Dog(DogAllOf dogAllOf, string className, string color = @"red") : base(className, color)
|
||||
public Dog(string breed, string className, string color = @"red") : base(className, color)
|
||||
{
|
||||
DogAllOf = dogAllOf;
|
||||
Breed = breed;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DogAllOf
|
||||
/// Gets or Sets Breed
|
||||
/// </summary>
|
||||
public DogAllOf DogAllOf { get; set; }
|
||||
[JsonPropertyName("breed")]
|
||||
public string Breed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@ -59,6 +60,7 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Dog {\n");
|
||||
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" Breed: ").Append(Breed).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -86,9 +88,7 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader dogAllOfReader = utf8JsonReader;
|
||||
bool dogAllOfDeserialized = Client.ClientUtils.TryDeserialize<DogAllOf>(ref utf8JsonReader, jsonSerializerOptions, out DogAllOf? dogAllOf);
|
||||
|
||||
string? breed = default;
|
||||
string? className = default;
|
||||
string? color = default;
|
||||
|
||||
@ -107,6 +107,9 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "breed":
|
||||
breed = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "className":
|
||||
className = utf8JsonReader.GetString();
|
||||
break;
|
||||
@ -119,16 +122,16 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
if (breed == null)
|
||||
throw new ArgumentNullException(nameof(breed), "Property is required for class Dog.");
|
||||
|
||||
if (className == null)
|
||||
throw new ArgumentNullException(nameof(className), "Property is required for class Dog.");
|
||||
|
||||
if (color == null)
|
||||
throw new ArgumentNullException(nameof(color), "Property is required for class Dog.");
|
||||
|
||||
if (dogAllOf == null)
|
||||
throw new ArgumentNullException(nameof(dogAllOf), "Property is required for class Dog.");
|
||||
|
||||
return new Dog(dogAllOf, className, color);
|
||||
return new Dog(breed, className, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -140,8 +143,13 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, dog.DogAllOf, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("breed", dog.Breed);
|
||||
writer.WriteString("className", dog.ClassName);
|
||||
writer.WriteString("color", dog.Color);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,27 +33,29 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EquilateralTriangle" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeInterface"></param>
|
||||
/// <param name="triangleInterface"></param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
internal EquilateralTriangle(ShapeInterface shapeInterface, TriangleInterface triangleInterface)
|
||||
public EquilateralTriangle(string shapeType, string triangleType)
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
public ShapeInterface ShapeInterface { get; set; }
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleInterface
|
||||
/// Gets or Sets TriangleType
|
||||
/// </summary>
|
||||
public TriangleInterface TriangleInterface { get; set; }
|
||||
[JsonPropertyName("triangleType")]
|
||||
public string TriangleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
@ -69,6 +71,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class EquilateralTriangle {\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" TriangleType: ").Append(TriangleType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -107,11 +111,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||
|
||||
Utf8JsonReader triangleInterfaceReader = utf8JsonReader;
|
||||
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface);
|
||||
string? shapeType = default;
|
||||
string? triangleType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -128,19 +129,25 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "triangleType":
|
||||
triangleType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shapeInterface == null)
|
||||
throw new ArgumentNullException(nameof(shapeInterface), "Property is required for class EquilateralTriangle.");
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class EquilateralTriangle.");
|
||||
|
||||
if (triangleInterface == null)
|
||||
throw new ArgumentNullException(nameof(triangleInterface), "Property is required for class EquilateralTriangle.");
|
||||
if (triangleType == null)
|
||||
throw new ArgumentNullException(nameof(triangleType), "Property is required for class EquilateralTriangle.");
|
||||
|
||||
return new EquilateralTriangle(shapeInterface, triangleInterface);
|
||||
return new EquilateralTriangle(shapeType, triangleType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -152,10 +159,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, equilateralTriangle.ShapeInterface, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, equilateralTriangle.TriangleInterface, jsonSerializerOptions);
|
||||
writer.WriteString("shapeType", equilateralTriangle.ShapeType);
|
||||
writer.WriteString("triangleType", equilateralTriangle.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,12 +33,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Fruit" /> class.
|
||||
/// </summary>
|
||||
/// <param name="apple?"></param>
|
||||
/// <param name="apple"></param>
|
||||
/// <param name="cultivar">cultivar</param>
|
||||
/// <param name="lengthCm">lengthCm</param>
|
||||
/// <param name="origin">origin</param>
|
||||
/// <param name="color">color</param>
|
||||
[JsonConstructor]
|
||||
public Fruit(Apple? apple, string color)
|
||||
public Fruit(Apple? apple, string cultivar, decimal lengthCm, string origin, string color)
|
||||
{
|
||||
Apple = apple;
|
||||
Cultivar = cultivar;
|
||||
LengthCm = lengthCm;
|
||||
Origin = origin;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
@ -47,11 +53,17 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Fruit" /> class.
|
||||
/// </summary>
|
||||
/// <param name="banana"></param>
|
||||
/// <param name="cultivar">cultivar</param>
|
||||
/// <param name="lengthCm">lengthCm</param>
|
||||
/// <param name="origin">origin</param>
|
||||
/// <param name="color">color</param>
|
||||
[JsonConstructor]
|
||||
public Fruit(Banana banana, string color)
|
||||
public Fruit(Banana? banana, string cultivar, decimal lengthCm, string origin, string color)
|
||||
{
|
||||
Banana = banana;
|
||||
Cultivar = cultivar;
|
||||
LengthCm = lengthCm;
|
||||
Origin = origin;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
@ -68,6 +80,24 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public Banana? Banana { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
[JsonPropertyName("cultivar")]
|
||||
public string Cultivar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
[JsonPropertyName("lengthCm")]
|
||||
public decimal LengthCm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Origin
|
||||
/// </summary>
|
||||
[JsonPropertyName("origin")]
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
@ -83,6 +113,9 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Fruit {\n");
|
||||
sb.Append(" Color: ").Append(Color).Append("\n");
|
||||
sb.Append(" Cultivar: ").Append(Cultivar).Append("\n");
|
||||
sb.Append(" LengthCm: ").Append(LengthCm).Append("\n");
|
||||
sb.Append(" Origin: ").Append(Origin).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -94,6 +127,20 @@ namespace Org.OpenAPITools.Model
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
@ -120,6 +167,9 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? cultivar = default;
|
||||
decimal? lengthCm = default;
|
||||
string? origin = default;
|
||||
string? color = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
@ -137,6 +187,16 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "cultivar":
|
||||
cultivar = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "lengthCm":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
lengthCm = utf8JsonReader.GetDecimal();
|
||||
break;
|
||||
case "origin":
|
||||
origin = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "color":
|
||||
color = utf8JsonReader.GetString();
|
||||
break;
|
||||
@ -146,16 +206,25 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
if (cultivar == null)
|
||||
throw new ArgumentNullException(nameof(cultivar), "Property is required for class Fruit.");
|
||||
|
||||
if (lengthCm == null)
|
||||
throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Fruit.");
|
||||
|
||||
if (origin == null)
|
||||
throw new ArgumentNullException(nameof(origin), "Property is required for class Fruit.");
|
||||
|
||||
if (color == null)
|
||||
throw new ArgumentNullException(nameof(color), "Property is required for class Fruit.");
|
||||
|
||||
Utf8JsonReader appleReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, jsonSerializerOptions, out Apple? apple))
|
||||
return new Fruit(apple, color);
|
||||
return new Fruit(apple, cultivar, lengthCm.Value, origin, color);
|
||||
|
||||
Utf8JsonReader bananaReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, jsonSerializerOptions, out Banana? banana))
|
||||
return new Fruit(banana, color);
|
||||
return new Fruit(banana, cultivar, lengthCm.Value, origin, color);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -173,6 +242,14 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, fruit.Banana, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("cultivar", fruit.Cultivar);
|
||||
writer.WriteNumber("lengthCm", fruit.LengthCm);
|
||||
writer.WriteString("origin", fruit.Origin);
|
||||
writer.WriteString("color", fruit.Color);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="FruitReq" /> class.
|
||||
/// </summary>
|
||||
/// <param name="appleReq"></param>
|
||||
/// <param name="cultivar">cultivar</param>
|
||||
/// <param name="lengthCm">lengthCm</param>
|
||||
/// <param name="mealy">mealy</param>
|
||||
/// <param name="sweet">sweet</param>
|
||||
[JsonConstructor]
|
||||
internal FruitReq(AppleReq appleReq)
|
||||
public FruitReq(AppleReq? appleReq, string cultivar, decimal lengthCm, bool mealy, bool sweet)
|
||||
{
|
||||
AppleReq = appleReq;
|
||||
Cultivar = cultivar;
|
||||
LengthCm = lengthCm;
|
||||
Mealy = mealy;
|
||||
Sweet = sweet;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -45,10 +53,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="FruitReq" /> class.
|
||||
/// </summary>
|
||||
/// <param name="bananaReq"></param>
|
||||
/// <param name="cultivar">cultivar</param>
|
||||
/// <param name="lengthCm">lengthCm</param>
|
||||
/// <param name="mealy">mealy</param>
|
||||
/// <param name="sweet">sweet</param>
|
||||
[JsonConstructor]
|
||||
internal FruitReq(BananaReq bananaReq)
|
||||
public FruitReq(BananaReq? bananaReq, string cultivar, decimal lengthCm, bool mealy, bool sweet)
|
||||
{
|
||||
BananaReq = bananaReq;
|
||||
Cultivar = cultivar;
|
||||
LengthCm = lengthCm;
|
||||
Mealy = mealy;
|
||||
Sweet = sweet;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -64,6 +80,30 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public BananaReq? BananaReq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
[JsonPropertyName("cultivar")]
|
||||
public string Cultivar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
[JsonPropertyName("lengthCm")]
|
||||
public decimal LengthCm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Mealy
|
||||
/// </summary>
|
||||
[JsonPropertyName("mealy")]
|
||||
public bool Mealy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Sweet
|
||||
/// </summary>
|
||||
[JsonPropertyName("sweet")]
|
||||
public bool Sweet { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
@ -72,6 +112,10 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class FruitReq {\n");
|
||||
sb.Append(" Cultivar: ").Append(Cultivar).Append("\n");
|
||||
sb.Append(" LengthCm: ").Append(LengthCm).Append("\n");
|
||||
sb.Append(" Mealy: ").Append(Mealy).Append("\n");
|
||||
sb.Append(" Sweet: ").Append(Sweet).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -109,6 +153,11 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? cultivar = default;
|
||||
decimal? lengthCm = default;
|
||||
bool? mealy = default;
|
||||
bool? sweet = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
@ -124,19 +173,46 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "cultivar":
|
||||
cultivar = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "lengthCm":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
lengthCm = utf8JsonReader.GetDecimal();
|
||||
break;
|
||||
case "mealy":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
mealy = utf8JsonReader.GetBoolean();
|
||||
break;
|
||||
case "sweet":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
sweet = utf8JsonReader.GetBoolean();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cultivar == null)
|
||||
throw new ArgumentNullException(nameof(cultivar), "Property is required for class FruitReq.");
|
||||
|
||||
if (lengthCm == null)
|
||||
throw new ArgumentNullException(nameof(lengthCm), "Property is required for class FruitReq.");
|
||||
|
||||
if (mealy == null)
|
||||
throw new ArgumentNullException(nameof(mealy), "Property is required for class FruitReq.");
|
||||
|
||||
if (sweet == null)
|
||||
throw new ArgumentNullException(nameof(sweet), "Property is required for class FruitReq.");
|
||||
|
||||
Utf8JsonReader appleReqReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<AppleReq>(ref appleReqReader, jsonSerializerOptions, out AppleReq? appleReq))
|
||||
return new FruitReq(appleReq);
|
||||
return new FruitReq(appleReq, cultivar, lengthCm.Value, mealy.Value, sweet.Value);
|
||||
|
||||
Utf8JsonReader bananaReqReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<BananaReq>(ref bananaReqReader, jsonSerializerOptions, out BananaReq? bananaReq))
|
||||
return new FruitReq(bananaReq);
|
||||
return new FruitReq(bananaReq, cultivar, lengthCm.Value, mealy.Value, sweet.Value);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -154,6 +230,14 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, fruitReq.BananaReq, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("cultivar", fruitReq.Cultivar);
|
||||
writer.WriteNumber("lengthCm", fruitReq.LengthCm);
|
||||
writer.WriteBoolean("mealy", fruitReq.Mealy);
|
||||
writer.WriteBoolean("sweet", fruitReq.Sweet);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,14 +33,20 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GmFruit" /> class.
|
||||
/// </summary>
|
||||
/// <param name="apple?"></param>
|
||||
/// <param name="apple"></param>
|
||||
/// <param name="banana"></param>
|
||||
/// <param name="cultivar">cultivar</param>
|
||||
/// <param name="lengthCm">lengthCm</param>
|
||||
/// <param name="origin">origin</param>
|
||||
/// <param name="color">color</param>
|
||||
[JsonConstructor]
|
||||
public GmFruit(Apple? apple, Banana banana, string color)
|
||||
public GmFruit(Apple? apple, Banana? banana, string cultivar, decimal lengthCm, string origin, string color)
|
||||
{
|
||||
Apple = Apple;
|
||||
Banana = Banana;
|
||||
Cultivar = cultivar;
|
||||
LengthCm = lengthCm;
|
||||
Origin = origin;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
@ -57,6 +63,24 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public Banana? Banana { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
[JsonPropertyName("cultivar")]
|
||||
public string Cultivar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
[JsonPropertyName("lengthCm")]
|
||||
public decimal LengthCm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Origin
|
||||
/// </summary>
|
||||
[JsonPropertyName("origin")]
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
@ -72,6 +96,9 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class GmFruit {\n");
|
||||
sb.Append(" Color: ").Append(Color).Append("\n");
|
||||
sb.Append(" Cultivar: ").Append(Cultivar).Append("\n");
|
||||
sb.Append(" LengthCm: ").Append(LengthCm).Append("\n");
|
||||
sb.Append(" Origin: ").Append(Origin).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -83,6 +110,20 @@ namespace Org.OpenAPITools.Model
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
@ -115,6 +156,9 @@ namespace Org.OpenAPITools.Model
|
||||
Utf8JsonReader bananaReader = utf8JsonReader;
|
||||
bool bananaDeserialized = Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, jsonSerializerOptions, out Banana? banana);
|
||||
|
||||
string? cultivar = default;
|
||||
decimal? lengthCm = default;
|
||||
string? origin = default;
|
||||
string? color = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
@ -132,6 +176,16 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "cultivar":
|
||||
cultivar = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "lengthCm":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
lengthCm = utf8JsonReader.GetDecimal();
|
||||
break;
|
||||
case "origin":
|
||||
origin = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "color":
|
||||
color = utf8JsonReader.GetString();
|
||||
break;
|
||||
@ -141,10 +195,19 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
if (cultivar == null)
|
||||
throw new ArgumentNullException(nameof(cultivar), "Property is required for class GmFruit.");
|
||||
|
||||
if (lengthCm == null)
|
||||
throw new ArgumentNullException(nameof(lengthCm), "Property is required for class GmFruit.");
|
||||
|
||||
if (origin == null)
|
||||
throw new ArgumentNullException(nameof(origin), "Property is required for class GmFruit.");
|
||||
|
||||
if (color == null)
|
||||
throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit.");
|
||||
|
||||
return new GmFruit(apple, banana, color);
|
||||
return new GmFruit(apple, banana, cultivar, lengthCm.Value, origin, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -160,6 +223,14 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, gmFruit.Banana, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("cultivar", gmFruit.Cultivar);
|
||||
writer.WriteNumber("lengthCm", gmFruit.LengthCm);
|
||||
writer.WriteString("origin", gmFruit.Origin);
|
||||
writer.WriteString("color", gmFruit.Color);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,27 +33,29 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IsoscelesTriangle" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeInterface"></param>
|
||||
/// <param name="triangleInterface"></param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
internal IsoscelesTriangle(ShapeInterface shapeInterface, TriangleInterface triangleInterface)
|
||||
public IsoscelesTriangle(string shapeType, string triangleType)
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
public ShapeInterface ShapeInterface { get; set; }
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleInterface
|
||||
/// Gets or Sets TriangleType
|
||||
/// </summary>
|
||||
public TriangleInterface TriangleInterface { get; set; }
|
||||
[JsonPropertyName("triangleType")]
|
||||
public string TriangleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@ -63,6 +65,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class IsoscelesTriangle {\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" TriangleType: ").Append(TriangleType).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -100,11 +104,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||
|
||||
Utf8JsonReader triangleInterfaceReader = utf8JsonReader;
|
||||
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface);
|
||||
string? shapeType = default;
|
||||
string? triangleType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -121,19 +122,25 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "triangleType":
|
||||
triangleType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shapeInterface == null)
|
||||
throw new ArgumentNullException(nameof(shapeInterface), "Property is required for class IsoscelesTriangle.");
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class IsoscelesTriangle.");
|
||||
|
||||
if (triangleInterface == null)
|
||||
throw new ArgumentNullException(nameof(triangleInterface), "Property is required for class IsoscelesTriangle.");
|
||||
if (triangleType == null)
|
||||
throw new ArgumentNullException(nameof(triangleType), "Property is required for class IsoscelesTriangle.");
|
||||
|
||||
return new IsoscelesTriangle(shapeInterface, triangleInterface);
|
||||
return new IsoscelesTriangle(shapeType, triangleType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -145,10 +152,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, isoscelesTriangle.ShapeInterface, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, isoscelesTriangle.TriangleInterface, jsonSerializerOptions);
|
||||
writer.WriteString("shapeType", isoscelesTriangle.ShapeType);
|
||||
writer.WriteString("triangleType", isoscelesTriangle.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="whale"></param>
|
||||
/// <param name="className">className</param>
|
||||
/// <param name="hasBaleen">hasBaleen</param>
|
||||
/// <param name="hasTeeth">hasTeeth</param>
|
||||
/// <param name="type">type</param>
|
||||
[JsonConstructor]
|
||||
internal Mammal(Whale whale)
|
||||
public Mammal(Whale? whale, string className, bool hasBaleen, bool hasTeeth, TypeEnum type)
|
||||
{
|
||||
Whale = whale;
|
||||
ClassName = className;
|
||||
HasBaleen = hasBaleen;
|
||||
HasTeeth = hasTeeth;
|
||||
Type = type;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -45,10 +53,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zebra"></param>
|
||||
/// <param name="className">className</param>
|
||||
/// <param name="hasBaleen">hasBaleen</param>
|
||||
/// <param name="hasTeeth">hasTeeth</param>
|
||||
/// <param name="type">type</param>
|
||||
[JsonConstructor]
|
||||
internal Mammal(Zebra zebra)
|
||||
public Mammal(Zebra? zebra, string className, bool hasBaleen, bool hasTeeth, TypeEnum type)
|
||||
{
|
||||
Zebra = zebra;
|
||||
ClassName = className;
|
||||
HasBaleen = hasBaleen;
|
||||
HasTeeth = hasTeeth;
|
||||
Type = type;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -56,15 +72,109 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="pig"></param>
|
||||
/// <param name="className">className</param>
|
||||
/// <param name="hasBaleen">hasBaleen</param>
|
||||
/// <param name="hasTeeth">hasTeeth</param>
|
||||
/// <param name="type">type</param>
|
||||
[JsonConstructor]
|
||||
internal Mammal(Pig pig)
|
||||
public Mammal(Pig? pig, string className, bool hasBaleen, bool hasTeeth, TypeEnum type)
|
||||
{
|
||||
Pig = pig;
|
||||
ClassName = className;
|
||||
HasBaleen = hasBaleen;
|
||||
HasTeeth = hasTeeth;
|
||||
Type = type;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines Type
|
||||
/// </summary>
|
||||
public enum TypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Plains for value: plains
|
||||
/// </summary>
|
||||
Plains = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Mountain for value: mountain
|
||||
/// </summary>
|
||||
Mountain = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Grevys for value: grevys
|
||||
/// </summary>
|
||||
Grevys = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="TypeEnum"/>
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static TypeEnum TypeEnumFromString(string value)
|
||||
{
|
||||
if (value == "plains")
|
||||
return TypeEnum.Plains;
|
||||
|
||||
if (value == "mountain")
|
||||
return TypeEnum.Mountain;
|
||||
|
||||
if (value == "grevys")
|
||||
return TypeEnum.Grevys;
|
||||
|
||||
throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="TypeEnum"/>
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static TypeEnum? TypeEnumFromStringOrDefault(string value)
|
||||
{
|
||||
if (value == "plains")
|
||||
return TypeEnum.Plains;
|
||||
|
||||
if (value == "mountain")
|
||||
return TypeEnum.Mountain;
|
||||
|
||||
if (value == "grevys")
|
||||
return TypeEnum.Grevys;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the <see cref="TypeEnum"/> to the json value
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static string TypeEnumToJsonValue(TypeEnum value)
|
||||
{
|
||||
if (value == TypeEnum.Plains)
|
||||
return "plains";
|
||||
|
||||
if (value == TypeEnum.Mountain)
|
||||
return "mountain";
|
||||
|
||||
if (value == TypeEnum.Grevys)
|
||||
return "grevys";
|
||||
|
||||
throw new NotImplementedException($"Value could not be handled: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Type
|
||||
/// </summary>
|
||||
[JsonPropertyName("type")]
|
||||
public TypeEnum Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Whale
|
||||
/// </summary>
|
||||
@ -80,6 +190,24 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public Pig? Pig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[JsonPropertyName("className")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets HasBaleen
|
||||
/// </summary>
|
||||
[JsonPropertyName("hasBaleen")]
|
||||
public bool HasBaleen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets HasTeeth
|
||||
/// </summary>
|
||||
[JsonPropertyName("hasTeeth")]
|
||||
public bool HasTeeth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
@ -94,6 +222,10 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Mammal {\n");
|
||||
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
|
||||
sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n");
|
||||
sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n");
|
||||
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -142,6 +274,11 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? className = default;
|
||||
bool? hasBaleen = default;
|
||||
bool? hasTeeth = default;
|
||||
Mammal.TypeEnum? type = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
@ -157,23 +294,52 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "className":
|
||||
className = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "hasBaleen":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
hasBaleen = utf8JsonReader.GetBoolean();
|
||||
break;
|
||||
case "hasTeeth":
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.Null)
|
||||
hasTeeth = utf8JsonReader.GetBoolean();
|
||||
break;
|
||||
case "type":
|
||||
string? typeRawValue = utf8JsonReader.GetString();
|
||||
type = typeRawValue == null
|
||||
? null
|
||||
: Mammal.TypeEnumFromStringOrDefault(typeRawValue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (className == null)
|
||||
throw new ArgumentNullException(nameof(className), "Property is required for class Mammal.");
|
||||
|
||||
if (hasBaleen == null)
|
||||
throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Mammal.");
|
||||
|
||||
if (hasTeeth == null)
|
||||
throw new ArgumentNullException(nameof(hasTeeth), "Property is required for class Mammal.");
|
||||
|
||||
if (type == null)
|
||||
throw new ArgumentNullException(nameof(type), "Property is required for class Mammal.");
|
||||
|
||||
Utf8JsonReader whaleReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Whale>(ref whaleReader, jsonSerializerOptions, out Whale? whale))
|
||||
return new Mammal(whale);
|
||||
return new Mammal(whale, className, hasBaleen.Value, hasTeeth.Value, type.Value);
|
||||
|
||||
Utf8JsonReader zebraReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Zebra>(ref zebraReader, jsonSerializerOptions, out Zebra? zebra))
|
||||
return new Mammal(zebra);
|
||||
return new Mammal(zebra, className, hasBaleen.Value, hasTeeth.Value, type.Value);
|
||||
|
||||
Utf8JsonReader pigReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Pig>(ref pigReader, jsonSerializerOptions, out Pig? pig))
|
||||
return new Mammal(pig);
|
||||
return new Mammal(pig, className, hasBaleen.Value, hasTeeth.Value, type.Value);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -193,6 +359,19 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, mammal.Pig, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("className", mammal.ClassName);
|
||||
writer.WriteBoolean("hasBaleen", mammal.HasBaleen);
|
||||
writer.WriteBoolean("hasTeeth", mammal.HasTeeth);
|
||||
|
||||
var typeRawValue = Mammal.TypeEnumToJsonValue(mammal.Type);
|
||||
if (typeRawValue != null)
|
||||
writer.WriteString("type", typeRawValue);
|
||||
else
|
||||
writer.WriteNull("type");
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,16 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="NullableShape" /> class.
|
||||
/// </summary>
|
||||
/// <param name="triangle"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
internal NullableShape(Triangle triangle)
|
||||
public NullableShape(Triangle? triangle, string quadrilateralType, string shapeType, string triangleType)
|
||||
{
|
||||
Triangle = triangle;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -45,10 +51,16 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="NullableShape" /> class.
|
||||
/// </summary>
|
||||
/// <param name="quadrilateral"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
internal NullableShape(Quadrilateral quadrilateral)
|
||||
public NullableShape(Quadrilateral? quadrilateral, string quadrilateralType, string shapeType, string triangleType)
|
||||
{
|
||||
Quadrilateral = quadrilateral;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -64,6 +76,24 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public Quadrilateral? Quadrilateral { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets QuadrilateralType
|
||||
/// </summary>
|
||||
[JsonPropertyName("quadrilateralType")]
|
||||
public string QuadrilateralType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleType
|
||||
/// </summary>
|
||||
[JsonPropertyName("triangleType")]
|
||||
public string TriangleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
@ -78,6 +108,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class NullableShape {\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -126,6 +158,10 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? quadrilateralType = default;
|
||||
string? shapeType = default;
|
||||
string? triangleType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
@ -141,19 +177,37 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "quadrilateralType":
|
||||
quadrilateralType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "triangleType":
|
||||
triangleType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (quadrilateralType == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class NullableShape.");
|
||||
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class NullableShape.");
|
||||
|
||||
if (triangleType == null)
|
||||
throw new ArgumentNullException(nameof(triangleType), "Property is required for class NullableShape.");
|
||||
|
||||
Utf8JsonReader triangleReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, jsonSerializerOptions, out Triangle? triangle))
|
||||
return new NullableShape(triangle);
|
||||
return new NullableShape(triangle, quadrilateralType, shapeType, triangleType);
|
||||
|
||||
Utf8JsonReader quadrilateralReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral))
|
||||
return new NullableShape(quadrilateral);
|
||||
return new NullableShape(quadrilateral, quadrilateralType, shapeType, triangleType);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -171,6 +225,13 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, nullableShape.Quadrilateral, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("quadrilateralType", nullableShape.QuadrilateralType);
|
||||
writer.WriteString("shapeType", nullableShape.ShapeType);
|
||||
writer.WriteString("triangleType", nullableShape.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,18 +35,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="varString"></param>
|
||||
[JsonConstructor]
|
||||
internal OneOfString(string varString)
|
||||
internal OneOfString(string? varString)
|
||||
{
|
||||
String = varString;
|
||||
VarString = varString;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// Gets or Sets VarString
|
||||
/// </summary>
|
||||
public string? String { get; set; }
|
||||
public string? VarString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
@ -137,8 +137,11 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, oneOfString.String, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, oneOfString.VarString, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="petType">petType</param>
|
||||
[JsonConstructor]
|
||||
internal ParentPet(string petType) : base(petType)
|
||||
public ParentPet(string petType) : base(petType)
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
@ -119,6 +119,11 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("pet_type", parentPet.PetType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Pig" /> class.
|
||||
/// </summary>
|
||||
/// <param name="basquePig"></param>
|
||||
/// <param name="className">className</param>
|
||||
[JsonConstructor]
|
||||
internal Pig(BasquePig basquePig)
|
||||
public Pig(BasquePig? basquePig, string className)
|
||||
{
|
||||
BasquePig = basquePig;
|
||||
ClassName = className;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -45,10 +47,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Pig" /> class.
|
||||
/// </summary>
|
||||
/// <param name="danishPig"></param>
|
||||
/// <param name="className">className</param>
|
||||
[JsonConstructor]
|
||||
internal Pig(DanishPig danishPig)
|
||||
public Pig(DanishPig? danishPig, string className)
|
||||
{
|
||||
DanishPig = danishPig;
|
||||
ClassName = className;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -64,6 +68,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public DanishPig? DanishPig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[JsonPropertyName("className")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
@ -78,6 +88,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Pig {\n");
|
||||
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -126,6 +137,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? className = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
@ -141,19 +154,25 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "className":
|
||||
className = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (className == null)
|
||||
throw new ArgumentNullException(nameof(className), "Property is required for class Pig.");
|
||||
|
||||
Utf8JsonReader basquePigReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<BasquePig>(ref basquePigReader, jsonSerializerOptions, out BasquePig? basquePig))
|
||||
return new Pig(basquePig);
|
||||
return new Pig(basquePig, className);
|
||||
|
||||
Utf8JsonReader danishPigReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<DanishPig>(ref danishPigReader, jsonSerializerOptions, out DanishPig? danishPig))
|
||||
return new Pig(danishPig);
|
||||
return new Pig(danishPig, className);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -171,6 +190,11 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, pig.DanishPig, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("className", pig.ClassName);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,9 +35,9 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="varBool"></param>
|
||||
[JsonConstructor]
|
||||
internal PolymorphicProperty(bool varBool)
|
||||
internal PolymorphicProperty(bool? varBool)
|
||||
{
|
||||
Bool = varBool;
|
||||
VarBool = varBool;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -46,9 +46,9 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="varString"></param>
|
||||
[JsonConstructor]
|
||||
internal PolymorphicProperty(string varString)
|
||||
internal PolymorphicProperty(string? varString)
|
||||
{
|
||||
String = varString;
|
||||
VarString = varString;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -57,44 +57,44 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="varObject"></param>
|
||||
[JsonConstructor]
|
||||
internal PolymorphicProperty(Object varObject)
|
||||
internal PolymorphicProperty(Object? varObject)
|
||||
{
|
||||
Object = varObject;
|
||||
VarObject = varObject;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class.
|
||||
/// </summary>
|
||||
/// <param name="liststring"></param>
|
||||
/// <param name="list"></param>
|
||||
[JsonConstructor]
|
||||
internal PolymorphicProperty(List<string> liststring)
|
||||
internal PolymorphicProperty(List<string>? list)
|
||||
{
|
||||
Liststring = liststring;
|
||||
List = list;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Bool
|
||||
/// Gets or Sets VarBool
|
||||
/// </summary>
|
||||
public bool? Bool { get; set; }
|
||||
public bool? VarBool { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// Gets or Sets VarString
|
||||
/// </summary>
|
||||
public string? String { get; set; }
|
||||
public string? VarString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Object
|
||||
/// Gets or Sets VarObject
|
||||
/// </summary>
|
||||
public Object? Object { get; set; }
|
||||
public Object? VarObject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Liststring
|
||||
/// Gets or Sets List
|
||||
/// </summary>
|
||||
public List<string>? Liststring { get; set; }
|
||||
public List<string>? List { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
@ -181,9 +181,9 @@ namespace Org.OpenAPITools.Model
|
||||
if (Client.ClientUtils.TryDeserialize<Object>(ref varObjectReader, jsonSerializerOptions, out Object? varObject))
|
||||
return new PolymorphicProperty(varObject);
|
||||
|
||||
Utf8JsonReader liststringReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<List<string>>(ref liststringReader, jsonSerializerOptions, out List<string>? liststring))
|
||||
return new PolymorphicProperty(liststring);
|
||||
Utf8JsonReader listReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<List<string>>(ref listReader, jsonSerializerOptions, out List<string>? list))
|
||||
return new PolymorphicProperty(list);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -197,14 +197,17 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.Bool, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.VarBool, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.String, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.VarString, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.Object, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.VarObject, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.Liststring, jsonSerializerOptions);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, polymorphicProperty.List, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,14 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Quadrilateral" /> class.
|
||||
/// </summary>
|
||||
/// <param name="simpleQuadrilateral"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
[JsonConstructor]
|
||||
internal Quadrilateral(SimpleQuadrilateral simpleQuadrilateral)
|
||||
public Quadrilateral(SimpleQuadrilateral? simpleQuadrilateral, string quadrilateralType, string shapeType)
|
||||
{
|
||||
SimpleQuadrilateral = simpleQuadrilateral;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -45,10 +49,14 @@ namespace Org.OpenAPITools.Model
|
||||
/// Initializes a new instance of the <see cref="Quadrilateral" /> class.
|
||||
/// </summary>
|
||||
/// <param name="complexQuadrilateral"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
[JsonConstructor]
|
||||
internal Quadrilateral(ComplexQuadrilateral complexQuadrilateral)
|
||||
public Quadrilateral(ComplexQuadrilateral? complexQuadrilateral, string quadrilateralType, string shapeType)
|
||||
{
|
||||
ComplexQuadrilateral = complexQuadrilateral;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -64,6 +72,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
public ComplexQuadrilateral? ComplexQuadrilateral { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets QuadrilateralType
|
||||
/// </summary>
|
||||
[JsonPropertyName("quadrilateralType")]
|
||||
public string QuadrilateralType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
@ -78,6 +98,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Quadrilateral {\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -126,6 +148,9 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? quadrilateralType = default;
|
||||
string? shapeType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
@ -141,19 +166,31 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "quadrilateralType":
|
||||
quadrilateralType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (quadrilateralType == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Quadrilateral.");
|
||||
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class Quadrilateral.");
|
||||
|
||||
Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<SimpleQuadrilateral>(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral? simpleQuadrilateral))
|
||||
return new Quadrilateral(simpleQuadrilateral);
|
||||
return new Quadrilateral(simpleQuadrilateral, quadrilateralType, shapeType);
|
||||
|
||||
Utf8JsonReader complexQuadrilateralReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<ComplexQuadrilateral>(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral? complexQuadrilateral))
|
||||
return new Quadrilateral(complexQuadrilateral);
|
||||
return new Quadrilateral(complexQuadrilateral, quadrilateralType, shapeType);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -171,6 +208,12 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("quadrilateralType", quadrilateral.QuadrilateralType);
|
||||
writer.WriteString("shapeType", quadrilateral.ShapeType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,27 +33,29 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScaleneTriangle" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeInterface"></param>
|
||||
/// <param name="triangleInterface"></param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
internal ScaleneTriangle(ShapeInterface shapeInterface, TriangleInterface triangleInterface)
|
||||
public ScaleneTriangle(string shapeType, string triangleType)
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
public ShapeInterface ShapeInterface { get; set; }
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleInterface
|
||||
/// Gets or Sets TriangleType
|
||||
/// </summary>
|
||||
public TriangleInterface TriangleInterface { get; set; }
|
||||
[JsonPropertyName("triangleType")]
|
||||
public string TriangleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
@ -69,6 +71,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class ScaleneTriangle {\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" TriangleType: ").Append(TriangleType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -107,11 +111,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||
|
||||
Utf8JsonReader triangleInterfaceReader = utf8JsonReader;
|
||||
bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize<TriangleInterface>(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface);
|
||||
string? shapeType = default;
|
||||
string? triangleType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -128,19 +129,25 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "triangleType":
|
||||
triangleType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shapeInterface == null)
|
||||
throw new ArgumentNullException(nameof(shapeInterface), "Property is required for class ScaleneTriangle.");
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class ScaleneTriangle.");
|
||||
|
||||
if (triangleInterface == null)
|
||||
throw new ArgumentNullException(nameof(triangleInterface), "Property is required for class ScaleneTriangle.");
|
||||
if (triangleType == null)
|
||||
throw new ArgumentNullException(nameof(triangleType), "Property is required for class ScaleneTriangle.");
|
||||
|
||||
return new ScaleneTriangle(shapeInterface, triangleInterface);
|
||||
return new ScaleneTriangle(shapeType, triangleType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -152,10 +159,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, scaleneTriangle.ShapeInterface, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, scaleneTriangle.TriangleInterface, jsonSerializerOptions);
|
||||
writer.WriteString("shapeType", scaleneTriangle.ShapeType);
|
||||
writer.WriteString("triangleType", scaleneTriangle.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,15 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="triangle"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public Shape(Triangle triangle, string quadrilateralType)
|
||||
public Shape(Triangle? triangle, string quadrilateralType, string shapeType, string triangleType)
|
||||
{
|
||||
Triangle = triangle;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -48,11 +52,15 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="quadrilateral"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public Shape(Quadrilateral quadrilateral, string quadrilateralType)
|
||||
public Shape(Quadrilateral? quadrilateral, string quadrilateralType, string shapeType, string triangleType)
|
||||
{
|
||||
Quadrilateral = quadrilateral;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -74,6 +82,18 @@ namespace Org.OpenAPITools.Model
|
||||
[JsonPropertyName("quadrilateralType")]
|
||||
public string QuadrilateralType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleType
|
||||
/// </summary>
|
||||
[JsonPropertyName("triangleType")]
|
||||
public string TriangleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
@ -89,6 +109,7 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Shape {\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -138,6 +159,8 @@ namespace Org.OpenAPITools.Model
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? quadrilateralType = default;
|
||||
string? shapeType = default;
|
||||
string? triangleType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -157,6 +180,12 @@ namespace Org.OpenAPITools.Model
|
||||
case "quadrilateralType":
|
||||
quadrilateralType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "triangleType":
|
||||
triangleType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -166,13 +195,19 @@ namespace Org.OpenAPITools.Model
|
||||
if (quadrilateralType == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape.");
|
||||
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class Shape.");
|
||||
|
||||
if (triangleType == null)
|
||||
throw new ArgumentNullException(nameof(triangleType), "Property is required for class Shape.");
|
||||
|
||||
Utf8JsonReader triangleReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, jsonSerializerOptions, out Triangle? triangle))
|
||||
return new Shape(triangle, quadrilateralType);
|
||||
return new Shape(triangle, quadrilateralType, shapeType, triangleType);
|
||||
|
||||
Utf8JsonReader quadrilateralReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral))
|
||||
return new Shape(quadrilateral, quadrilateralType);
|
||||
return new Shape(quadrilateral, quadrilateralType, shapeType, triangleType);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -190,6 +225,13 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, shape.Quadrilateral, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("quadrilateralType", shape.QuadrilateralType);
|
||||
writer.WriteString("shapeType", shape.ShapeType);
|
||||
writer.WriteString("triangleType", shape.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,15 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="triangle"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public ShapeOrNull(Triangle triangle, string quadrilateralType)
|
||||
public ShapeOrNull(Triangle? triangle, string quadrilateralType, string shapeType, string triangleType)
|
||||
{
|
||||
Triangle = triangle;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -48,11 +52,15 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="quadrilateral"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public ShapeOrNull(Quadrilateral quadrilateral, string quadrilateralType)
|
||||
public ShapeOrNull(Quadrilateral? quadrilateral, string quadrilateralType, string shapeType, string triangleType)
|
||||
{
|
||||
Quadrilateral = quadrilateral;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
TriangleType = triangleType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
@ -74,6 +82,18 @@ namespace Org.OpenAPITools.Model
|
||||
[JsonPropertyName("quadrilateralType")]
|
||||
public string QuadrilateralType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleType
|
||||
/// </summary>
|
||||
[JsonPropertyName("triangleType")]
|
||||
public string TriangleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
@ -89,6 +109,7 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class ShapeOrNull {\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -138,6 +159,8 @@ namespace Org.OpenAPITools.Model
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
string? quadrilateralType = default;
|
||||
string? shapeType = default;
|
||||
string? triangleType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -157,6 +180,12 @@ namespace Org.OpenAPITools.Model
|
||||
case "quadrilateralType":
|
||||
quadrilateralType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "triangleType":
|
||||
triangleType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -166,13 +195,19 @@ namespace Org.OpenAPITools.Model
|
||||
if (quadrilateralType == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull.");
|
||||
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeOrNull.");
|
||||
|
||||
if (triangleType == null)
|
||||
throw new ArgumentNullException(nameof(triangleType), "Property is required for class ShapeOrNull.");
|
||||
|
||||
Utf8JsonReader triangleReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Triangle>(ref triangleReader, jsonSerializerOptions, out Triangle? triangle))
|
||||
return new ShapeOrNull(triangle, quadrilateralType);
|
||||
return new ShapeOrNull(triangle, quadrilateralType, shapeType, triangleType);
|
||||
|
||||
Utf8JsonReader quadrilateralReader = utf8JsonReader;
|
||||
if (Client.ClientUtils.TryDeserialize<Quadrilateral>(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral))
|
||||
return new ShapeOrNull(quadrilateral, quadrilateralType);
|
||||
return new ShapeOrNull(quadrilateral, quadrilateralType, shapeType, triangleType);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
@ -190,6 +225,13 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("quadrilateralType", shapeOrNull.QuadrilateralType);
|
||||
writer.WriteString("shapeType", shapeOrNull.ShapeType);
|
||||
writer.WriteString("triangleType", shapeOrNull.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,27 +33,29 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SimpleQuadrilateral" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeInterface"></param>
|
||||
/// <param name="quadrilateralInterface"></param>
|
||||
/// <param name="quadrilateralType">quadrilateralType</param>
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
[JsonConstructor]
|
||||
internal SimpleQuadrilateral(ShapeInterface shapeInterface, QuadrilateralInterface quadrilateralInterface)
|
||||
public SimpleQuadrilateral(string quadrilateralType, string shapeType)
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
QuadrilateralInterface = quadrilateralInterface;
|
||||
QuadrilateralType = quadrilateralType;
|
||||
ShapeType = shapeType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// Gets or Sets QuadrilateralType
|
||||
/// </summary>
|
||||
public ShapeInterface ShapeInterface { get; set; }
|
||||
[JsonPropertyName("quadrilateralType")]
|
||||
public string QuadrilateralType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets QuadrilateralInterface
|
||||
/// Gets or Sets ShapeType
|
||||
/// </summary>
|
||||
public QuadrilateralInterface QuadrilateralInterface { get; set; }
|
||||
[JsonPropertyName("shapeType")]
|
||||
public string ShapeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
@ -69,6 +71,8 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class SimpleQuadrilateral {\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@ -107,11 +111,8 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = utf8JsonReader;
|
||||
bool shapeInterfaceDeserialized = Client.ClientUtils.TryDeserialize<ShapeInterface>(ref utf8JsonReader, jsonSerializerOptions, out ShapeInterface? shapeInterface);
|
||||
|
||||
Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader;
|
||||
bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface? quadrilateralInterface);
|
||||
string? quadrilateralType = default;
|
||||
string? shapeType = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
@ -128,19 +129,25 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "quadrilateralType":
|
||||
quadrilateralType = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "shapeType":
|
||||
shapeType = utf8JsonReader.GetString();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shapeInterface == null)
|
||||
throw new ArgumentNullException(nameof(shapeInterface), "Property is required for class SimpleQuadrilateral.");
|
||||
if (quadrilateralType == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class SimpleQuadrilateral.");
|
||||
|
||||
if (quadrilateralInterface == null)
|
||||
throw new ArgumentNullException(nameof(quadrilateralInterface), "Property is required for class SimpleQuadrilateral.");
|
||||
if (shapeType == null)
|
||||
throw new ArgumentNullException(nameof(shapeType), "Property is required for class SimpleQuadrilateral.");
|
||||
|
||||
return new SimpleQuadrilateral(shapeInterface, quadrilateralInterface);
|
||||
return new SimpleQuadrilateral(quadrilateralType, shapeType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -152,10 +159,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, simpleQuadrilateral.ShapeInterface, jsonSerializerOptions);
|
||||
writer.WriteStartObject();
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, simpleQuadrilateral.QuadrilateralInterface, jsonSerializerOptions);
|
||||
writer.WriteString("quadrilateralType", simpleQuadrilateral.QuadrilateralType);
|
||||
writer.WriteString("shapeType", simpleQuadrilateral.ShapeType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public Triangle(EquilateralTriangle equilateralTriangle, string shapeType, string triangleType)
|
||||
public Triangle(EquilateralTriangle? equilateralTriangle, string shapeType, string triangleType)
|
||||
{
|
||||
EquilateralTriangle = equilateralTriangle;
|
||||
ShapeType = shapeType;
|
||||
@ -52,7 +52,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public Triangle(IsoscelesTriangle isoscelesTriangle, string shapeType, string triangleType)
|
||||
public Triangle(IsoscelesTriangle? isoscelesTriangle, string shapeType, string triangleType)
|
||||
{
|
||||
IsoscelesTriangle = isoscelesTriangle;
|
||||
ShapeType = shapeType;
|
||||
@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="shapeType">shapeType</param>
|
||||
/// <param name="triangleType">triangleType</param>
|
||||
[JsonConstructor]
|
||||
public Triangle(ScaleneTriangle scaleneTriangle, string shapeType, string triangleType)
|
||||
public Triangle(ScaleneTriangle? scaleneTriangle, string shapeType, string triangleType)
|
||||
{
|
||||
ScaleneTriangle = scaleneTriangle;
|
||||
ShapeType = shapeType;
|
||||
@ -234,6 +234,12 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, triangle.ScaleneTriangle, jsonSerializerOptions);
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WriteString("shapeType", triangle.ShapeType);
|
||||
writer.WriteString("triangleType", triangle.TriangleType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,17 +25,14 @@ docs/models/BananaReq.md
|
||||
docs/models/BasquePig.md
|
||||
docs/models/Capitalization.md
|
||||
docs/models/Cat.md
|
||||
docs/models/CatAllOf.md
|
||||
docs/models/Category.md
|
||||
docs/models/ChildCat.md
|
||||
docs/models/ChildCatAllOf.md
|
||||
docs/models/ClassModel.md
|
||||
docs/models/ComplexQuadrilateral.md
|
||||
docs/models/DanishPig.md
|
||||
docs/models/DateOnlyClass.md
|
||||
docs/models/DeprecatedObject.md
|
||||
docs/models/Dog.md
|
||||
docs/models/DogAllOf.md
|
||||
docs/models/Drawing.md
|
||||
docs/models/EnumArrays.md
|
||||
docs/models/EnumClass.md
|
||||
@ -148,17 +145,14 @@ src/Org.OpenAPITools/Model/BananaReq.cs
|
||||
src/Org.OpenAPITools/Model/BasquePig.cs
|
||||
src/Org.OpenAPITools/Model/Capitalization.cs
|
||||
src/Org.OpenAPITools/Model/Cat.cs
|
||||
src/Org.OpenAPITools/Model/CatAllOf.cs
|
||||
src/Org.OpenAPITools/Model/Category.cs
|
||||
src/Org.OpenAPITools/Model/ChildCat.cs
|
||||
src/Org.OpenAPITools/Model/ChildCatAllOf.cs
|
||||
src/Org.OpenAPITools/Model/ClassModel.cs
|
||||
src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs
|
||||
src/Org.OpenAPITools/Model/DanishPig.cs
|
||||
src/Org.OpenAPITools/Model/DateOnlyClass.cs
|
||||
src/Org.OpenAPITools/Model/DeprecatedObject.cs
|
||||
src/Org.OpenAPITools/Model/Dog.cs
|
||||
src/Org.OpenAPITools/Model/DogAllOf.cs
|
||||
src/Org.OpenAPITools/Model/Drawing.cs
|
||||
src/Org.OpenAPITools/Model/EnumArrays.cs
|
||||
src/Org.OpenAPITools/Model/EnumClass.cs
|
||||
|
@ -1393,12 +1393,18 @@ components:
|
||||
Dog:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Animal'
|
||||
- $ref: '#/components/schemas/Dog_allOf'
|
||||
- properties:
|
||||
breed:
|
||||
type: string
|
||||
type: object
|
||||
Cat:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Animal'
|
||||
- $ref: '#/components/schemas/Address'
|
||||
- $ref: '#/components/schemas/Cat_allOf'
|
||||
- properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
type: object
|
||||
Address:
|
||||
additionalProperties:
|
||||
type: integer
|
||||
@ -2103,7 +2109,16 @@ components:
|
||||
ChildCat:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/ParentPet'
|
||||
- $ref: '#/components/schemas/ChildCat_allOf'
|
||||
- properties:
|
||||
name:
|
||||
type: string
|
||||
pet_type:
|
||||
default: ChildCat
|
||||
enum:
|
||||
- ChildCat
|
||||
type: string
|
||||
x-enum-as-string: true
|
||||
type: object
|
||||
ArrayOfEnums:
|
||||
items:
|
||||
$ref: '#/components/schemas/OuterEnum'
|
||||
@ -2364,40 +2379,14 @@ components:
|
||||
required:
|
||||
- requiredFile
|
||||
type: object
|
||||
getCountry_request_allOf:
|
||||
properties:
|
||||
country:
|
||||
type: string
|
||||
required:
|
||||
- country
|
||||
type: object
|
||||
getCountry_request:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/getCountry_request_allOf'
|
||||
Dog_allOf:
|
||||
properties:
|
||||
breed:
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
Cat_allOf:
|
||||
properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
type: object
|
||||
example: null
|
||||
ChildCat_allOf:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
pet_type:
|
||||
default: ChildCat
|
||||
enum:
|
||||
- ChildCat
|
||||
type: string
|
||||
x-enum-as-string: true
|
||||
type: object
|
||||
example: null
|
||||
- properties:
|
||||
country:
|
||||
type: string
|
||||
required:
|
||||
- country
|
||||
type: object
|
||||
securitySchemes:
|
||||
petstore_auth:
|
||||
flows:
|
||||
|
@ -6,6 +6,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**Color** | **string** | | [optional] [default to "red"]
|
||||
**Declawed** | **bool** | | [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)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Name** | **string** | | [optional]
|
||||
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -6,6 +6,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**Color** | **string** | | [optional] [default to "red"]
|
||||
**Breed** | **string** | | [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)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Color** | **string** | | [optional]
|
||||
**Cultivar** | **string** | | [optional]
|
||||
**LengthCm** | **decimal** | | [optional]
|
||||
**Origin** | **string** | | [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)
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Cultivar** | **string** | |
|
||||
**LengthCm** | **decimal** | |
|
||||
**Mealy** | **bool** | | [optional]
|
||||
**Sweet** | **bool** | | [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)
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Color** | **string** | | [optional]
|
||||
**Cultivar** | **string** | | [optional]
|
||||
**LengthCm** | **decimal** | | [optional]
|
||||
**Origin** | **string** | | [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)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**HasBaleen** | **bool** | | [optional]
|
||||
**HasTeeth** | **bool** | | [optional]
|
||||
**Type** | **string** | | [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)
|
||||
|
||||
|
@ -5,6 +5,8 @@ The value may be a shape or the 'null' value. The 'nullable' attribute was intro
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -6,6 +6,7 @@ The value may be a shape or the 'null' value. This is introduced in OAS schema >
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**QuadrilateralType** | **string** | |
|
||||
**ShapeType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -52,5 +52,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Cat
|
||||
//Assert.IsType<Cat>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Declawed'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DeclawedTest()
|
||||
{
|
||||
// TODO unit test for the property 'Declawed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" ChildCat
|
||||
//Assert.IsType<ChildCat>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'PetType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PetTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'PetType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" ComplexQuadrilateral
|
||||
//Assert.IsType<ComplexQuadrilateral>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Dog
|
||||
//Assert.IsType<Dog>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Breed'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BreedTest()
|
||||
{
|
||||
// TODO unit test for the property 'Breed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" EquilateralTriangle
|
||||
//Assert.IsType<EquilateralTriangle>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,41 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" FruitReq
|
||||
//Assert.IsType<FruitReq>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Mealy'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MealyTest()
|
||||
{
|
||||
// TODO unit test for the property 'Mealy'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Sweet'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SweetTest()
|
||||
{
|
||||
// TODO unit test for the property 'Sweet'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,32 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Origin'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OriginTest()
|
||||
{
|
||||
// TODO unit test for the property 'Origin'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,32 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Origin'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OriginTest()
|
||||
{
|
||||
// TODO unit test for the property 'Origin'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" IsoscelesTriangle
|
||||
//Assert.IsType<IsoscelesTriangle>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,41 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Mammal
|
||||
//Assert.IsType<Mammal>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'HasBaleen'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HasBaleenTest()
|
||||
{
|
||||
// TODO unit test for the property 'HasBaleen'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'HasTeeth'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HasTeethTest()
|
||||
{
|
||||
// TODO unit test for the property 'HasTeeth'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Type'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" NullableShape
|
||||
//Assert.IsType<NullableShape>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Pig
|
||||
//Assert.IsType<Pig>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +52,23 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO uncomment below to test "IsType" Quadrilateral
|
||||
//Assert.IsType<Quadrilateral>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user