forked from loafle/openapi-generator-original
partial fix
This commit is contained in:
parent
38dac13c26
commit
277b43bcea
@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: mp
|
||||
outputDir: samples/client/petstore/java-helidon-client/v3/mp
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 3.2.7
|
||||
artifactId: petstore-helidon-client-mp
|
||||
|
@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: mp
|
||||
outputDir: samples/client/petstore/java-helidon-client/v4/mp
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 4.0.11
|
||||
artifactId: petstore-helidon-client-mp
|
||||
|
@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: se
|
||||
outputDir: samples/client/petstore/java-helidon-client/v3/se
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 3.2.7
|
||||
artifactId: petstore-helidon-client-se
|
||||
|
@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: se
|
||||
outputDir: samples/client/petstore/java-helidon-client/v4/se
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 4.0.11
|
||||
artifactId: petstore-helidon-client-se
|
||||
|
@ -1,6 +1,7 @@
|
||||
generatorName: java-micronaut-client
|
||||
outputDir: samples/client/petstore/java-micronaut-client/
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-micronaut/
|
||||
additionalProperties:
|
||||
artifactId: petstore-micronaut
|
||||
hideGenerationTimestamp: "true"
|
||||
|
@ -1,6 +1,7 @@
|
||||
generatorName: java-micronaut-server
|
||||
outputDir: samples/server/petstore/java-micronaut-server/
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-micronaut/
|
||||
additionalProperties:
|
||||
artifactId: petstore-micronaut-server
|
||||
hideGenerationTimestamp: "true"
|
||||
|
@ -1,4 +1,4 @@
|
||||
public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{
|
||||
public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{
|
||||
|
||||
private {{classname}} instance;
|
||||
|
||||
|
@ -20,7 +20,12 @@
|
||||
{{/hasDiscriminatorWithNonEmptyMapping}}
|
||||
{{/isClassnameSanitized}}
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>xmlAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
@ -39,6 +44,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{>modelInnerEnum}}
|
||||
{{/mostInnerItems}}
|
||||
{{/isContainer}}
|
||||
|
||||
{{/isEnum}}
|
||||
{{#gson}}
|
||||
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
|
||||
@ -73,6 +79,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{^vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
{{#isContainer}}
|
||||
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
|
||||
{{/isContainer}}
|
||||
@ -191,6 +198,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
{{#jsonb}}
|
||||
@JsonbProperty("{{baseName}}")
|
||||
{{/jsonb}}
|
||||
|
@ -23,7 +23,12 @@
|
||||
@JsonTypeName("{{name}}")
|
||||
{{/isClassnameSanitized}}
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>xmlAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
@ -82,6 +87,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
|
||||
@ -199,6 +205,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
{{#useBeanValidation}}
|
||||
{{>beanValidation}}
|
||||
{{/useBeanValidation}}
|
||||
@ -235,7 +242,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() {
|
||||
return {{name}};
|
||||
}
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{#vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
|
||||
{{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
|
||||
{{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}}
|
||||
|
@ -23,7 +23,12 @@
|
||||
@JsonTypeName("{{name}}")
|
||||
{{/isClassnameSanitized}}
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>xmlAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
@ -44,6 +49,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{>modelInnerEnum}}
|
||||
{{/mostInnerItems}}
|
||||
{{/isContainer}}
|
||||
|
||||
{{/isEnum}}
|
||||
{{#gson}}
|
||||
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
|
||||
@ -82,6 +88,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
|
||||
@ -199,6 +206,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
{{#useBeanValidation}}
|
||||
{{>beanValidation}}
|
||||
{{/useBeanValidation}}
|
||||
@ -215,7 +223,11 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}}
|
||||
@JsonIgnore
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{^vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{#jackson}}
|
||||
{{> jackson_annotations}}
|
||||
{{/jackson}}
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
public {{{datatypeWithEnum}}} {{getter}}() {
|
||||
{{#vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}}
|
||||
@ -235,7 +247,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() {
|
||||
return {{name}};
|
||||
}
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{#vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
|
||||
{{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
|
||||
{{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}}
|
||||
@ -247,8 +260,15 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}}
|
||||
{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{>nullable_var_annotations}} {{{datatypeWithEnum}}} {{name}}) {
|
||||
{{#vendorExtensions.x-setter-extra-annotation}}
|
||||
{{{vendorExtensions.x-setter-extra-annotation}}}
|
||||
{{/vendorExtensions.x-setter-extra-annotation}}
|
||||
{{#jackson}}
|
||||
{{^vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{> jackson_annotations}}
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
{{/jackson}}
|
||||
public void {{setter}}({{>nullable_var_annotations}} {{{datatypeWithEnum}}} {{name}}) {
|
||||
{{#vendorExtensions.x-enum-as-string}}
|
||||
if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) {
|
||||
throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES));
|
||||
@ -288,11 +308,13 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
|
||||
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
|
||||
{{/useReflectionEqualsHashCode}}
|
||||
}{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
}
|
||||
{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
|
||||
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
|
||||
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
|
||||
}{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
}
|
||||
{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@ -302,14 +324,16 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{^useReflectionEqualsHashCode}}
|
||||
return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/additionalPropertiesType}});
|
||||
{{/useReflectionEqualsHashCode}}
|
||||
}{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
}
|
||||
{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
|
||||
private static <T> int hashCodeNullable(JsonNullable<T> a) {
|
||||
if (a == null) {
|
||||
return 1;
|
||||
}
|
||||
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
|
||||
}{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
}
|
||||
{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -26,7 +26,12 @@ import {{invokerPackage}}.ApiClient;
|
||||
{{/vars}}
|
||||
})
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>xmlAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
@ -47,6 +52,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{>modelInnerEnum}}
|
||||
{{/mostInnerItems}}
|
||||
{{/isContainer}}
|
||||
|
||||
{{/isEnum}}
|
||||
{{#gson}}
|
||||
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
|
||||
@ -573,6 +579,6 @@ static {
|
||||
{{/discriminator}}
|
||||
{{#generateBuilders}}
|
||||
|
||||
{{>javaBuilder}}
|
||||
{{>javaBuilder}}
|
||||
{{/generateBuilders}}
|
||||
}
|
||||
|
@ -25,7 +25,12 @@
|
||||
{{/hasDiscriminatorWithNonEmptyMapping}}
|
||||
{{/isClassnameSanitized}}
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>xmlAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
@ -44,6 +49,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{>modelInnerEnum}}
|
||||
{{/mostInnerItems}}
|
||||
{{/isContainer}}
|
||||
|
||||
{{/isEnum}}
|
||||
{{#gson}}
|
||||
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
|
||||
@ -66,6 +72,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
|
||||
{{/gson}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
{{#vendorExtensions.x-field-extra-annotation}}
|
||||
{{{vendorExtensions.x-field-extra-annotation}}}
|
||||
{{/vendorExtensions.x-field-extra-annotation}}
|
||||
@ -212,6 +219,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
{{>nullable_var_annotations}}
|
||||
|
||||
{{#jsonb}}
|
||||
@JsonbProperty("{{baseName}}")
|
||||
{{/jsonb}}
|
||||
|
@ -1,5 +1,4 @@
|
||||
{{#jackson}}
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization
|
||||
allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization
|
||||
|
@ -3,4 +3,6 @@
|
||||
@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
{{#jackson}}
|
||||
@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}}
|
||||
@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
{{/jackson}}
|
||||
{{/withXml}}
|
||||
|
@ -17,21 +17,35 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}}
|
||||
}){{/hasVars}}
|
||||
{{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}}
|
||||
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
|
||||
{{^parent}}
|
||||
@XmlRootElement(name="{{classname}}")
|
||||
{{/parent}}
|
||||
{{/withXml}}
|
||||
{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{#description}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{#description}}
|
||||
/**
|
||||
* {{{description}}}
|
||||
*/
|
||||
@ApiModel(description="{{{description}}}")
|
||||
{{/description}}{{>additionalModelTypeAnnotations}}
|
||||
{{/description}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
|
||||
{{#vars}}{{#isEnum}}{{^isContainer}}
|
||||
{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}}
|
||||
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
|
||||
{{#vars}}
|
||||
{{#isEnum}}
|
||||
{{^isContainer}}
|
||||
{{>enumClass}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#mostInnerItems}}
|
||||
{{>enumClass}}
|
||||
{{/mostInnerItems}}
|
||||
{{/isContainer}}
|
||||
{{/isEnum}}
|
||||
{{#description}}
|
||||
/**
|
||||
* {{{.}}}
|
||||
|
@ -3,6 +3,10 @@
|
||||
{{#hasVars}} @XmlType(name = "{{classname}}", propOrder =
|
||||
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}}
|
||||
}){{/hasVars}}
|
||||
{{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}}
|
||||
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
|
||||
{{^hasVars}}
|
||||
@XmlType(name = "{{classname}}")
|
||||
{{/hasVars}}
|
||||
{{^parent}}
|
||||
@XmlRootElement(name="{{classname}}")
|
||||
{{/parent}}
|
||||
{{/withXml}}
|
@ -9,7 +9,11 @@
|
||||
{{/vars}}
|
||||
})
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
|
@ -9,7 +9,11 @@
|
||||
{{/vars}}
|
||||
})
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
{{/vendorExtensions.x-class-extra-annotation}}
|
||||
|
@ -42,3 +42,4 @@
|
||||
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,8 @@ import {{javaxPackage}}.validation.Valid;
|
||||
/**
|
||||
* {{description}}{{^description}}{{classname}}{{/description}}
|
||||
*/
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
@ -33,15 +34,11 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
|
||||
{{{vendorExtensions.x-field-extra-annotation}}}
|
||||
{{/vendorExtensions.x-field-extra-annotation}}
|
||||
{{#isContainer}}
|
||||
{{#useBeanValidation}}
|
||||
{{>beanValidation}}
|
||||
{{/useBeanValidation}}
|
||||
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}
|
||||
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
|
||||
{{/isContainer}}
|
||||
{{^isContainer}}
|
||||
{{#useBeanValidation}}
|
||||
{{>beanValidation}}
|
||||
{{/useBeanValidation}}
|
||||
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}
|
||||
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
|
||||
{{/isContainer}}
|
||||
|
||||
|
@ -69,7 +69,7 @@ public interface {{classname}}Delegate {
|
||||
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}{{#isFormParam}}MultipartFile{{/isFormParam}}{{^isFormParam}}{{>optionalDataType}}{{/isFormParam}}{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
|
||||
{{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
|
||||
{{>methodBody}}
|
||||
{{>methodBody}}
|
||||
}{{/jdk8-default-interface}}
|
||||
|
||||
{{/operation}}
|
||||
|
@ -2,8 +2,8 @@
|
||||
{{#examples}}
|
||||
{{#-first}}
|
||||
{{#async}}
|
||||
return CompletableFuture.supplyAsync(()-> {
|
||||
{{/async}}getRequest().ifPresent(request -> {
|
||||
return CompletableFuture.supplyAsync(()-> {
|
||||
{{/async}} getRequest().ifPresent(request -> {
|
||||
{{#async}} {{/async}} for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
{{/-first}}
|
||||
{{#async}} {{/async}}{{^async}} {{/async}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) {
|
||||
@ -24,7 +24,7 @@ return CompletableFuture.supplyAsync(()-> {
|
||||
{{/-last}}
|
||||
{{/examples}}
|
||||
{{^examples}}
|
||||
{{#useResponseEntity}}return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#async}}){{/async}};
|
||||
{{#useResponseEntity}} return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#async}}){{/async}};
|
||||
{{/useResponseEntity}}
|
||||
{{^useResponseEntity}}throw new IllegalArgumentException("Not implemented");
|
||||
{{/useResponseEntity}}
|
||||
|
@ -3,4 +3,5 @@
|
||||
@JacksonXmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
{{/jackson}}
|
||||
@XmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
@XmlAccessorType(XmlAccessType.FIELD){{/withXml}}
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
{{/withXml}}
|
||||
|
@ -27,7 +27,11 @@ using {{packageName}}.Converters;
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
namespace {{modelPackage}}
|
||||
{ {{#isEnum}}{{>enumClass}}{{/isEnum}}{{^isEnum}}
|
||||
{
|
||||
{{#isEnum}}
|
||||
{{>enumClass}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
/// <summary>
|
||||
/// {{description}}
|
||||
/// </summary>
|
||||
@ -60,6 +64,7 @@ namespace {{modelPackage}}
|
||||
{{^complexType}}
|
||||
{{>enumClass}}
|
||||
{{/complexType}}
|
||||
|
||||
{{/isEnum}}
|
||||
/// <summary>
|
||||
/// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
|
@ -51,14 +51,14 @@ bool {{classname}}::validate(std::stringstream& msg, const std::string& pathPref
|
||||
{{#required}}/* {{name}} */ {{/required}}{
|
||||
const {{{dataType}}}& value = m_{{name}};
|
||||
const std::string currentValuePath = _pathPrefix + ".{{nameInCamelCase}}";
|
||||
{{> model-validation-body }}
|
||||
{{> model-validation-body }}
|
||||
}
|
||||
{{/isArray}}{{^isArray}}{{#hasValidation}} {{! Only generate validation if necessary }}
|
||||
{{^required}}if ({{nameInCamelCase}}IsSet()){{/required}}
|
||||
{{#required}}/* {{name}} */ {{/required}}{
|
||||
const {{{dataType}}}& value = m_{{name}};
|
||||
const std::string currentValuePath = _pathPrefix + ".{{nameInCamelCase}}";
|
||||
{{> model-validation-body }}
|
||||
{{> model-validation-body }}
|
||||
}
|
||||
{{/hasValidation}}{{#required}}{{#isModel}}
|
||||
if (!m_{{name}}.validate(msg, _pathPrefix + ".{{nameInCamelCase}}")) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
const auto request = session->get_request();
|
||||
const auto request = session->get_request();
|
||||
{{#hasBodyParam}}
|
||||
// body params or form params here from the body content string
|
||||
std::string bodyContent = extractBodyContent(session);
|
||||
|
@ -151,7 +151,7 @@ void {{vendorExtensions.x-codegen-resource-name}}Resource::defaultSessionClose(c
|
||||
void {{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}}_internal(const std::shared_ptr<restbed::Session> session)
|
||||
{
|
||||
{{#lambda.indented}}
|
||||
{{>api-source-HandlerBody}}
|
||||
{{>api-source-HandlerBody}}
|
||||
{{/lambda.indented}}
|
||||
|
||||
}
|
||||
@ -160,7 +160,7 @@ void {{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}
|
||||
// x-extension
|
||||
void {{vendorExtensions.x-codegen-resource-name}}Resource::handler_{{httpMethod}}_internal(const std::shared_ptr<restbed::Session> session) {
|
||||
{{#lambda.indented}}
|
||||
{{>api-source-HandlerBody}}
|
||||
{{>api-source-HandlerBody}}
|
||||
{{/lambda.indented}}
|
||||
|
||||
}
|
||||
|
@ -8,3 +8,4 @@
|
||||
{{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}},
|
||||
{{/vars}}
|
||||
});
|
||||
|
||||
|
@ -1 +1,2 @@
|
||||
{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}}
|
||||
|
||||
|
@ -223,7 +223,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
|
||||
{{>beanValidation}}
|
||||
{{/useBeanValidation}}
|
||||
{{^useBeanValidation}}
|
||||
{{#required}}@NotNull{{/required}}
|
||||
{{#required}}
|
||||
@NotNull
|
||||
{{/required}}
|
||||
{{/useBeanValidation}}
|
||||
{{#swagger2AnnotationLibrary}}
|
||||
@Schema(name = "{{{baseName}}}"{{#isReadOnly}}, accessMode = Schema.AccessMode.READ_ONLY{{/isReadOnly}}{{#example}}, example = "{{{.}}}"{{/example}}{{#description}}, description = "{{{.}}}"{{/description}}{{#deprecated}}, deprecated = true{{/deprecated}}, requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}})
|
||||
|
@ -1,4 +1,7 @@
|
||||
{{>additionalOneOfTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}}
|
||||
{{>additionalOneOfTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{>xmlAnnotation}}
|
||||
public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
|
||||
{{#discriminator}}
|
||||
public {{propertyType}} {{propertyGetter}}();
|
||||
|
@ -46,3 +46,4 @@
|
||||
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,3 +60,4 @@
|
||||
{{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,3 +185,4 @@
|
||||
}
|
||||
{{/responses}}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,12 @@
|
||||
{{#additionalModelTypeAnnotations}}
|
||||
{{{.}}}
|
||||
{{/additionalModelTypeAnnotations}}
|
||||
{{>common/generatedAnnotation}}{{#discriminator}}{{>common/model/typeInfoAnnotation}}{{/discriminator}}{{>common/model/xmlAnnotation}}{{#useBeanValidation}}
|
||||
{{>common/generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>common/model/typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>common/model/xmlAnnotation}}
|
||||
{{#useBeanValidation}}
|
||||
@Introspected
|
||||
{{/useBeanValidation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
|
@ -1,8 +1,11 @@
|
||||
/**
|
||||
* {{description}}{{^description}}{{classname}}{{/description}}
|
||||
*/{{#description}}
|
||||
@ApiModel(description = "{{{.}}}"){{/description}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}
|
||||
*/
|
||||
{{#description}}
|
||||
@ApiModel(description = "{{{.}}}")
|
||||
{{/description}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
{{>generatedAnnotation}}
|
||||
public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
|
||||
{{#vars}}
|
||||
{{#isEnum}}
|
||||
|
@ -2,8 +2,15 @@
|
||||
* {{description}}{{^description}}{{classname}}{{/description}}
|
||||
*/{{#description}}
|
||||
@ApiModel(description = "{{{.}}}"){{/description}}
|
||||
{{#useBeanValidation}}@Validated{{/useBeanValidation}}
|
||||
{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{>additionalModelTypeAnnotations}}
|
||||
{{#useBeanValidation}}
|
||||
@Validated
|
||||
{{/useBeanValidation}}
|
||||
{{>generatedAnnotation}}
|
||||
{{#discriminator}}
|
||||
{{>typeInfoAnnotation}}
|
||||
{{/discriminator}}
|
||||
{{>xmlAnnotation}}
|
||||
{{>additionalModelTypeAnnotations}}
|
||||
public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
|
||||
{{#serializableModel}}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -3,4 +3,5 @@
|
||||
@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
{{/jackson}}
|
||||
@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
@XmlAccessorType(XmlAccessType.FIELD){{/withXml}}
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
{{/withXml}}
|
||||
|
@ -35,7 +35,7 @@ interface {{classname}}Delegate {
|
||||
*/
|
||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isFile}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} {
|
||||
{{>methodBody}}
|
||||
{{>methodBody}}
|
||||
}{{/skipDefaultDelegateInterface}}
|
||||
|
||||
{{/operation}}
|
||||
|
@ -19,12 +19,12 @@
|
||||
{{/-last}}{{/optionalVars}}
|
||||
) {{/discriminator}}{{#parent}}: {{{.}}}{{#serializableModel}}, Serializable{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}: Serializable{{/serializableModel}}{{/parent}}{
|
||||
{{#discriminator}}
|
||||
{{#requiredVars}}
|
||||
{{>interfaceReqVar}}
|
||||
{{/requiredVars}}
|
||||
{{#optionalVars}}
|
||||
{{>interfaceOptVar}}
|
||||
{{/optionalVars}}
|
||||
{{#requiredVars}}
|
||||
{{>interfaceReqVar}}
|
||||
{{/requiredVars}}
|
||||
{{#optionalVars}}
|
||||
{{>interfaceOptVar}}
|
||||
{{/optionalVars}}
|
||||
{{/discriminator}}
|
||||
{{#hasEnums}}{{#vars}}{{#isEnum}}
|
||||
/**
|
||||
|
@ -1,5 +1,10 @@
|
||||
{{#swagger2AnnotationLibrary}}
|
||||
@get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}
|
||||
@get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}}
|
||||
{{{.}}}{{/vendorExtensions.x-field-extra-annotation}}
|
||||
{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}}
|
||||
@get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}")\
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
{{#swagger1AnnotationLibrary}}
|
||||
@get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}")
|
||||
{{/swagger1AnnotationLibrary}}
|
||||
{{#vendorExtensions.x-field-extra-annotation}}
|
||||
{{{.}}}
|
||||
{{/vendorExtensions.x-field-extra-annotation}}
|
||||
{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}?{{^discriminator}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}}
|
||||
|
@ -1,5 +1,10 @@
|
||||
{{#swagger2AnnotationLibrary}}
|
||||
@get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}
|
||||
@get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}}
|
||||
{{{.}}}{{/vendorExtensions.x-field-extra-annotation}}
|
||||
@get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}")
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
{{#swagger1AnnotationLibrary}}
|
||||
@get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}")
|
||||
{{/swagger1AnnotationLibrary}}
|
||||
{{#vendorExtensions.x-field-extra-annotation}}
|
||||
{{{.}}}
|
||||
{{/vendorExtensions.x-field-extra-annotation}}
|
||||
{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}
|
||||
|
@ -2,8 +2,8 @@
|
||||
{{#examples}}
|
||||
{{#-first}}
|
||||
{{#async}}
|
||||
return CompletableFuture.supplyAsync(()-> {
|
||||
{{/async}}getRequest().ifPresent { request ->
|
||||
return CompletableFuture.supplyAsync(()-> {
|
||||
{{/async}} getRequest().ifPresent { request ->
|
||||
{{#async}} {{/async}} for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
{{/-first}}
|
||||
{{#async}} {{/async}}{{^async}} {{/async}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) {
|
||||
@ -20,9 +20,9 @@ return CompletableFuture.supplyAsync(()-> {
|
||||
{{/-last}}
|
||||
{{/examples}}
|
||||
{{^examples}}
|
||||
return {{#async}}CompletableFuture.completedFuture({{/async}}ResponseEntity({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}})
|
||||
return {{#async}}CompletableFuture.completedFuture({{/async}}ResponseEntity({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}})
|
||||
{{/examples}}
|
||||
{{/reactive}}
|
||||
{{#reactive}}
|
||||
return ResponseEntity({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}})
|
||||
return ResponseEntity({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}})
|
||||
{{/reactive}}
|
@ -265,3 +265,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,3 +107,4 @@
|
||||
{{/bodyParam}}
|
||||
{{/x-consumes-basic}}
|
||||
{{/vendorExtensions}}
|
||||
|
||||
|
@ -63,3 +63,4 @@
|
||||
Ok(h) => h,
|
||||
Err(e) => return Err(ApiError(format!("Unable to create header: {} - {}", multipart_header, e)))
|
||||
});
|
||||
|
||||
|
@ -20,3 +20,4 @@
|
||||
{{/x-produces-plain-text}}
|
||||
{{/x-produces-bytes}}
|
||||
{{/vendorExtensions}}
|
||||
|
||||
|
@ -74,3 +74,4 @@ let param_{{{paramName}}} = match param_{{{paramName}}} {
|
||||
{{/formParams}}
|
||||
};
|
||||
{{/vendorExtensions.x-consumes-basic}}
|
||||
|
||||
|
@ -16,3 +16,4 @@
|
||||
info!("{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}({{#allParams}}{{#vendorExtensions}}{{{x-format-string}}}{{/vendorExtensions}}{{^-last}}, {{/-last}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}, {{{paramName}}}{{/allParams}}, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@
|
||||
write_multipart(&mut body, &boundary, &body_parts)
|
||||
.expect("Failed to write multipart body");
|
||||
{{/-last}}
|
||||
|
||||
|
@ -58,3 +58,4 @@ pub enum {{{operationId}}}Response {
|
||||
{{/-last}}
|
||||
{{/responses}}
|
||||
}
|
||||
|
||||
|
@ -58,3 +58,4 @@ impl<T, C, Target> hyper::service::Service<Target> for MakeService<T, C> where
|
||||
future::ok(service)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,3 +316,4 @@
|
||||
}
|
||||
{{/vendorExtensions.x-has-request-body}}
|
||||
},
|
||||
|
||||
|
@ -21,3 +21,4 @@ mod paths {
|
||||
{{/hasPathParams}}
|
||||
{{/pathSet}}
|
||||
}
|
||||
|
||||
|
@ -50,3 +50,4 @@
|
||||
.expect("Unable to create Bad Request response for missing body parameter {{{baseName}}}")),
|
||||
};
|
||||
{{/required}}
|
||||
|
||||
|
@ -22,3 +22,4 @@
|
||||
{{/isMap}}
|
||||
{{/formParams}}
|
||||
{{/vendorExtensions}}
|
||||
|
||||
|
@ -18,3 +18,4 @@
|
||||
{{/bodyParams}}
|
||||
{{/x-consumes-multipart}}
|
||||
{{/vendorExtensions}}
|
||||
|
||||
|
@ -96,3 +96,4 @@
|
||||
}
|
||||
};
|
||||
{{/formParams}}
|
||||
|
||||
|
@ -84,3 +84,4 @@
|
||||
};
|
||||
{{/required}}
|
||||
{{/formParams}}
|
||||
|
||||
|
@ -48,3 +48,4 @@
|
||||
{{/vendorExtensions}}
|
||||
*response.body_mut() = Body::from(body);
|
||||
{{/dataType}}
|
||||
|
||||
|
@ -12,3 +12,4 @@
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,3 +92,4 @@ impl<T, C> hyper::service::Service<(Request<Body>, C)> for Service<T, C> where
|
||||
Please update both places if changing how this code is autogenerated.
|
||||
}}
|
||||
match method {
|
||||
|
||||
|
@ -1,6 +1 @@
|
||||
{{^authName}}
|
||||
delegate.{{operationId}}.handle(req, {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses)
|
||||
{{/authName}}
|
||||
{{#authName}}
|
||||
delegate.{{operationId}}.handle_{{authName}}(auth, req, {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses)
|
||||
{{/authName}}
|
||||
{{^authName}}delegate.{{operationId}}.handle(req, {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses){{/authName}}{{#authName}}delegate.{{operationId}}.handle_{{authName}}(auth, req, {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses){{/authName}}
|
||||
|
@ -1,6 +1 @@
|
||||
{{^authName}}
|
||||
delegate.{{operationId}}.handle(req, req.asJsonDecode[{{{bodyParam.dataType}}}] , {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses)
|
||||
{{/authName}}
|
||||
{{#authName}}
|
||||
delegate.{{operationId}}.handle_{{authName}}(auth, req, req.asJsonDecode[{{{bodyParam.dataType}}}] , {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses)
|
||||
{{/authName}}
|
||||
{{^authName}}delegate.{{operationId}}.handle(req, req.asJsonDecode[{{{bodyParam.dataType}}}] , {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses){{/authName}}{{#authName}}delegate.{{operationId}}.handle_{{authName}}(auth, req, req.asJsonDecode[{{{bodyParam.dataType}}}] , {{#pathParams}}{{baseName}}, {{/pathParams}}{{#queryParams}}{{baseName}}, {{/queryParams}}responses){{/authName}}
|
||||
|
2
pom.xml
2
pom.xml
@ -1227,7 +1227,7 @@
|
||||
<jackson-threetenbp.version>2.15.2</jackson-threetenbp.version>
|
||||
<jackson.version>2.17.1</jackson.version>
|
||||
<jacoco.version>0.8.10</jacoco.version>
|
||||
<jmustache.version>1.15</jmustache.version>
|
||||
<jmustache.version>1.16</jmustache.version>
|
||||
<junit.version>5.10.2</junit.version>
|
||||
<kotlin.version>1.6.21</kotlin.version>
|
||||
<kotlin-compiler-embeddable.version>1.6.21</kotlin-compiler-embeddable.version>
|
||||
|
@ -141,7 +141,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -143,7 +143,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -182,7 +182,6 @@ namespace Org.OpenAPITools.Model
|
||||
yield return x;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ namespace Org.OpenAPITools.Model
|
||||
[EnumMember(Value = "unclassified")]
|
||||
Unclassified = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DefaultValue" /> class.
|
||||
/// </summary>
|
||||
@ -281,7 +280,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -159,7 +159,6 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,6 @@ namespace Org.OpenAPITools.Model
|
||||
Sold = 3
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
@ -255,7 +254,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ namespace Org.OpenAPITools.Model
|
||||
[EnumMember(Value = "SKIPPED")]
|
||||
SKIPPED = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Query" /> class.
|
||||
/// </summary>
|
||||
@ -164,7 +163,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -137,7 +137,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -123,7 +123,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -179,7 +179,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -124,7 +124,6 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
}
|
||||
|
@ -160,4 +160,3 @@ func (v *NullableBird) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,4 +160,3 @@ func (v *NullableCategory) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -209,4 +209,3 @@ func (v *NullableDataQuery) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,4 +388,3 @@ func (v *NullableDefaultValue) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -196,4 +196,3 @@ func (v *NullableNumberPropertiesOnly) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -329,4 +329,3 @@ func (v *NullablePet) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,4 +161,3 @@ func (v *NullableQuery) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,4 +111,3 @@ func (v *NullableStringEnumRef) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
@ -160,4 +160,3 @@ func (v *NullableTag) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,4 +232,3 @@ func (v *NullableTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParame
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,4 +124,3 @@ func (v *NullableTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter) U
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,4 +160,3 @@ func (v *NullableBird) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,4 +160,3 @@ func (v *NullableCategory) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -209,4 +209,3 @@ func (v *NullableDataQuery) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,4 +388,3 @@ func (v *NullableDefaultValue) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -196,4 +196,3 @@ func (v *NullableNumberPropertiesOnly) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -329,4 +329,3 @@ func (v *NullablePet) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,4 +161,3 @@ func (v *NullableQuery) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,4 +111,3 @@ func (v *NullableStringEnumRef) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
@ -160,4 +160,3 @@ func (v *NullableTag) UnmarshalJSON(src []byte) error {
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,4 +124,3 @@ func (v *NullableTestFormObjectMultipartRequestMarker) UnmarshalJSON(src []byte)
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,4 +232,3 @@ func (v *NullableTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParame
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,4 +124,3 @@ func (v *NullableTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter) U
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,14 +34,13 @@ import java.util.StringJoiner;
|
||||
Bird.JSON_PROPERTY_COLOR
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0-SNAPSHOT")
|
||||
|
||||
public class Bird {
|
||||
public static final String JSON_PROPERTY_SIZE = "size";
|
||||
@javax.annotation.Nullable
|
||||
private String size;
|
||||
@javax.annotation.Nullable private String size;
|
||||
|
||||
public static final String JSON_PROPERTY_COLOR = "color";
|
||||
@javax.annotation.Nullable
|
||||
private String color;
|
||||
@javax.annotation.Nullable private String color;
|
||||
|
||||
public Bird() {
|
||||
}
|
||||
@ -56,8 +55,7 @@ public class Bird {
|
||||
* Get size
|
||||
* @return size
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSize() {
|
||||
@ -81,8 +79,7 @@ public class Bird {
|
||||
* Get color
|
||||
* @return color
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getColor() {
|
||||
|
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