Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit ee94685

Browse files
committed
Samples regenerated
[v2] Restructures endpoint data (#35) * Restructures endpoint data, modules written for responses * Endpoint docs improved, not done yet * Updates header_params * Updates path_parameters * Updates cookie_params, updates x_params to say key + input type * Samples updated * Fixes DefaultCodegenTests v2.0.0 adds request_body module (#46) * Java and template updates for separate request body module * Samples updated * Samples regenerated V2.0.0 adds parameter modules, response packages, and response header modules (#47) * Adds parameter template and code to write it * Writes module for each parameter * Removes prependFormOrBodyParameters * Sample regenrated * Samples regenerated * Fixes readme example * simplifies setting items and additional_properties var names * Regenerates sample with fixed schema names * Samples regenerated * Fixes java docstirng typo * Fixes JavaModelTest tests * Fixes tests in JavaModelEnumTest * FIxes tests in JavaClientCodegenTest * FIxes tests in DefaultGeneratorTest * FIxes tests in DefaultCodegenTest * Adds HeaderParameterWithoutName to api_client * Sample regenerated, responses are now modules * Moves request body schemas to the root indentation level of the response modules * Adds code to generate response header modules * Updates fromParameter * Sample updated, fixed bug where form param was not seen as body * Samples regenerated * Fixes java tests 2.0.0, moves models into components.schema package (#51) * python client modelPackage updated * Fixes links in model_doc template * Samples updated and python client path methods updated * Models sucessfully moved into components/schema in one sample * Replaces model import with components.schema * Fixes readme imports * Fixes model doc links from endpoint docs * Samples regenerated * Fixes manual test model imports * Samples regenerated, added init for test components * Removes model models folders Changes complexType to refClass (#52)
1 parent a4f38b7 commit ee94685

File tree

2,850 files changed

+152676
-144484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,850 files changed

+152676
-144484
lines changed

docs/new-generator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ Name | Type | Description | Notes
309309
------------ | ------------- | ------------- | -------------
310310
{{#parent}}
311311
{{#parentVars}}
312-
**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
312+
**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{refClass}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
313313
{{/parentVars}}
314314
{{/parent}}
315-
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
315+
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{refClass}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
316316
{{/vars}}
317317
318318
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/templating.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ Supporting files can either be processed through the templating engine or copied
807807
808808
> This is a very limited list of variable name explanations. Feel free to [open a pull request](https://github.com/OpenAPITools/openapi-generator/pull/new/master) to add to this documentation!
809809
810-
- **complexType**: stores the name of the model (e.g. Pet)
810+
- **refClass**: stores the name of the model (e.g. Pet)
811811
- **isContainer**: true if the parameter or property is an array or a map.
812812
- **isPrimitiveType**: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec.
813813

modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
2626
*/
2727
public String openApiType;
2828
public String baseName;
29-
public String complexType;
29+
public String refClass;
3030
public String getter;
3131
public String setter;
3232
/**
@@ -258,12 +258,12 @@ public void setBaseName(String baseName) {
258258
this.baseName = baseName;
259259
}
260260

261-
public String getComplexType() {
262-
return complexType;
261+
public String getRefClass() {
262+
return refClass;
263263
}
264264

265-
public void setComplexType(String complexType) {
266-
this.complexType = complexType;
265+
public void setRefClass(String refClass) {
266+
this.refClass = refClass;
267267
}
268268

269269
public String getGetter() {
@@ -978,7 +978,7 @@ public String toString() {
978978
final StringBuilder sb = new StringBuilder("CodegenProperty{");
979979
sb.append("openApiType='").append(openApiType).append('\'');
980980
sb.append(", baseName='").append(baseName).append('\'');
981-
sb.append(", complexType='").append(complexType).append('\'');
981+
sb.append(", refClass='").append(refClass).append('\'');
982982
sb.append(", getter='").append(getter).append('\'');
983983
sb.append(", setter='").append(setter).append('\'');
984984
sb.append(", description='").append(description).append('\'');
@@ -1151,7 +1151,7 @@ public boolean equals(Object o) {
11511151
Objects.equals(composedSchemas, that.composedSchemas) &&
11521152
Objects.equals(openApiType, that.openApiType) &&
11531153
Objects.equals(baseName, that.baseName) &&
1154-
Objects.equals(complexType, that.complexType) &&
1154+
Objects.equals(refClass, that.refClass) &&
11551155
Objects.equals(getter, that.getter) &&
11561156
Objects.equals(setter, that.setter) &&
11571157
Objects.equals(description, that.description) &&
@@ -1197,7 +1197,7 @@ public boolean equals(Object o) {
11971197
@Override
11981198
public int hashCode() {
11991199

1200-
return Objects.hash(openApiType, baseName, complexType, getter, setter, description,
1200+
return Objects.hash(openApiType, baseName, refClass, getter, setter, description,
12011201
dataType, datatypeWithEnum, dataFormat, name, min, max, defaultValue,
12021202
defaultValueWithParam, baseType, containerType, title, unescapedDescription,
12031203
maxLength, minLength, pattern, example, jsonSchema, minimum, maximum,

modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
9393
private Map<String, CodegenProperty> requiredVarsMap;
9494
private String ref;
9595
private boolean schemaIsFromAdditionalProperties;
96+
public Set<String> imports = new TreeSet<>();
9697

9798
@Override
9899
public int hashCode() {
@@ -105,7 +106,7 @@ public int hashCode() {
105106
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
106107
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired,
107108
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content,
108-
requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
109+
requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties, imports);
109110
}
110111

111112
@Override
@@ -155,6 +156,7 @@ public boolean equals(Object o) {
155156
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
156157
getHasVars() == that.getHasVars() &&
157158
getHasRequired() == that.getHasRequired() &&
159+
Objects.equals(imports, that.imports) &&
158160
Objects.equals(uniqueItemsBoolean, that.getUniqueItemsBoolean()) &&
159161
Objects.equals(ref, that.getRef()) &&
160162
Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) &&
@@ -612,6 +614,7 @@ public String toString() {
612614
sb.append(", requiredVarsMap=").append(requiredVarsMap);
613615
sb.append(", ref=").append(ref);
614616
sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties);
617+
sb.append(", imports=").append(imports);
615618
sb.append('}');
616619
return sb.toString();
617620
}

0 commit comments

Comments
 (0)