Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,26 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties

public Set<String> imports = new TreeSet<String>();
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel, isDeprecated;
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum;
/**
* Indicates the OAS schema specifies "nullable: true".
*/
public boolean isNullable;
/**
* Indicates the type has at least one required property.
*/
public boolean hasRequired;
/**
* Indicates the type has at least one optional property.
*/
public boolean hasOptional;
public boolean isArrayModel;
public boolean hasChildren;
public boolean isMapModel;
/**
* Indicates the OAS schema specifies "deprecated: true".
*/
public boolean isDeprecated;
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
public ExternalDocumentation externalDocumentation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ public String lowerCamelCase(String name) {
}

/**
* Output the type declaration of a given name
* Output the language-specific type declaration of a given OAS name.
*
* @param name name
* @return a string presentation of the type
Expand All @@ -2018,15 +2018,15 @@ public String getTypeDeclaration(String name) {
}

/**
* Output the type declaration of the property
* Output the language-specific type declaration of the property.
*
* @param schema property schema
* @return a string presentation of the property type
*/
public String getTypeDeclaration(Schema schema) {
if (schema == null) {
LOGGER.warn("Null schema found. Default type to `NULL_SCHMEA_ERR`");
return "NULL_SCHMEA_ERR";
LOGGER.warn("Null schema found. Default type to `NULL_SCHEMA_ERR`");
return "NULL_SCHEMA_ERR";
}

String oasType = getSchemaType(schema);
Expand Down Expand Up @@ -2812,7 +2812,7 @@ public String getterAndSetterCapitalize(String name) {
* Convert OAS Property object to Codegen Property object
*
* @param name name of the property
* @param p OAS property object
* @param p OAS property schema
* @return Codegen Property object
*/
public CodegenProperty fromProperty(String name, Schema p) {
Expand Down