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

v2 CodegenModel cleanup #103

Merged
merged 41 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3bb2a11
CodegenModel extends CodegenProperty
spacether Dec 15, 2022
5474860
Updates the fromModel signature
spacether Dec 15, 2022
67baf06
Removes unused code, updates fromModel to use fromProperty
spacether Dec 15, 2022
965e247
fromModel now uses a fromProperty helper
spacether Dec 15, 2022
d476dc2
Removes parent and child properties
spacether Dec 15, 2022
c6356cd
Removes interfaces + interfaceModels
spacether Dec 15, 2022
cbd2f7b
Removes vars properties
spacether Dec 15, 2022
1b89cb6
Removes mandatory properties
spacether Dec 15, 2022
a8033ed
Removes 5 unused properties
spacether Dec 15, 2022
e9513bb
Removes classFilename
spacether Dec 15, 2022
1b12b6b
Removes model dataType
spacether Dec 15, 2022
c8775aa
Removes type variables from codegenProperty
spacether Dec 16, 2022
8c3e6f9
Switches className for name.getCamelCaseName
spacether Dec 16, 2022
750c6f8
Updates staticmethod and class names to follow python naming conventions
spacether Dec 16, 2022
71952f7
Converts properties to Properties
spacether Dec 16, 2022
cfa6050
More fixes for property class name cases
spacether Dec 16, 2022
ef4fd00
Adds more schema case fixes
spacether Dec 17, 2022
799b5bc
Fixes the last of the schema name reference issues
spacether Dec 17, 2022
a6f1580
Fixes python tests
spacether Dec 17, 2022
1c68196
Removes model classname property usages
spacether Dec 17, 2022
7276d97
Removes classname/classVarName/modelJson
spacether Dec 17, 2022
54619d2
Some small needed java fixes
spacether Dec 17, 2022
2f715fc
Moves externalDocumentation into ocdegenProperty
spacether Dec 17, 2022
419f5d4
Shortens and improves CodegenParameter equals method
spacether Dec 17, 2022
d0c86c9
Adds externalDocs interface to JsonSchema
spacether Dec 17, 2022
8442613
Moves discriminator into CodegenProperty
spacether Dec 17, 2022
ae0286f
Moves discriminator creation into fromProperty
spacether Dec 18, 2022
f8fd2f2
Moves imports into CodegenProperty
spacether Dec 18, 2022
17a1768
Replaces CodegenModel with CodegenProperty
spacether Dec 18, 2022
3aab251
CodegenProperty renamed to CodegenSchema
spacether Dec 18, 2022
a8456e7
Updates debugging info
spacether Dec 18, 2022
3ddc25a
Removes unused java code
spacether Dec 18, 2022
b7e56a4
Removes unused java code
spacether Dec 18, 2022
cdda55f
Fixes syntax errors in defaultcodegentests
spacether Dec 18, 2022
ead0ca1
DefaultCodegenTest failures reduced to 3
spacether Dec 18, 2022
9d3c335
Fixes one test
spacether Dec 18, 2022
4c89331
Fixes java tests
spacether Dec 18, 2022
4ac046c
Fixes DefaultGeneratorTest.testRefModelValidationProperties
spacether Dec 18, 2022
2627551
Fixes java tests
spacether Dec 18, 2022
d49bd39
Samples regenerated
spacether Dec 19, 2022
ccbf3ce
Samples regenerated with endpoint test fix
spacether Dec 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ openapi-generator generate -g go ...

...
...
[main] DEBUG o.o.codegen.DefaultCodegen - debugging fromProperty for files : class Schema {
[main] DEBUG o.o.codegen.DefaultCodegen - debugging fromSchema for files : class Schema {
type: null
format: null
$ref: #/components/schemas/File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ public interface CodegenConfig {

String escapeQuotationMark(String input);

String getTypeDeclaration(Schema schema);

void processOpts();

List<CliOption> cliOptions();
Expand All @@ -145,7 +143,7 @@ public interface CodegenConfig {

void setOutputDir(String dir);

CodegenModel fromModel(String name, Schema schema);
CodegenSchema fromSchema(Schema schema, String sourceJsonPath);

CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, List<Server> servers);

Expand Down Expand Up @@ -277,7 +275,7 @@ public interface CodegenConfig {

Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs);

void postProcessModelProperty(CodegenModel model, CodegenProperty property);
void postProcessModelProperty(CodegenSchema model, CodegenSchema property);

void postProcessParameter(CodegenParameter parameter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CodegenHeader implements OpenapiComponent {
public String jsonSchema;
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
public boolean isDeprecated;
protected CodegenProperty schema;
protected CodegenSchema schema;
/**
* Determines whether this parameter is mandatory. If the parameter is in "path",
* this property is required and its value MUST be true. Otherwise, the property
Expand Down Expand Up @@ -156,11 +156,11 @@ public String toString() {
return sb.toString();
}

public CodegenProperty getSchema() {
public CodegenSchema getSchema() {
return schema;
}

public void setSchema(CodegenProperty schema) {
public void setSchema(CodegenSchema schema) {
this.schema = schema;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
import java.util.Objects;

public class CodegenMediaType {
private CodegenProperty schema;
private CodegenSchema schema;
private LinkedHashMap<String, CodegenEncoding> encoding;
private HashMap<String, SchemaTestCase> testCases = new HashMap<>();

public CodegenMediaType(CodegenProperty schema, LinkedHashMap<String, CodegenEncoding> encoding, HashMap<String, SchemaTestCase> testCases) {
public CodegenMediaType(CodegenSchema schema, LinkedHashMap<String, CodegenEncoding> encoding, HashMap<String, SchemaTestCase> testCases) {
this.schema = schema;
this.encoding = encoding;
if (testCases != null) {
this.testCases = testCases;
}
}

public CodegenProperty getSchema() {
public CodegenSchema getSchema() {
return schema;
}

Expand Down
Loading