Skip to content
Open
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ after_success:
echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME";
fi;
fi;
## NOTE; we will do the followign manually instead as the page doesn't need to be updated in every single travis build
## NOTE; we will do the following manually instead as the page doesn't need to be updated in every single travis build
## publish latest website, variables below are secure environment variables which are unavailable to PRs from forks.
# - if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# sed -i "s/Vector{UInt8}/Vector\{UInt8\}/g" docs/generators/julia-client.md;
Expand Down
2 changes: 1 addition & 1 deletion bin/utils/test_file_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java"
sha256: 325fdd5d7e2c97790c0fb44f712ab7b2ba022d7e1a5b0056f47b07f342682b6d
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java"
sha256: e673d9928c8eb848262d0116fe0d28db832e128671a810a7c966d06d90cb9b63
sha256: 44aef898ae3f5ac75e3847aa24a8eca259eb922be920162df0b725a6b751a6ca
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java"
sha256: 8b1b8f2a2ad00ccb090873a94a5f73e328b98317d2ec715f53bd7a1accb2a023
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java"
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/postgresql-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultDatabaseName|Database name that will be used for all generated PostgreSQL DDL and DML statements.| ||
|idAutoIncEnabled|If `true`, generates autoincrement PostgreSQL types `SERIAL` and `BIGSERIAL` for `int32` and `int64` respectively for integer fields with name 'id'.| |false|
|identifierNamingConvention|Naming convention of PostgreSQL idebntifiers (table names and column names).|<dl><dt>**snake_case**</dt><dd>Transform named to 'snake_case'.</dd><dt>**original**</dt><dd>Leave original names as in `YAML` file.</dd></dl>|snake_case|
|jsonDataType|Use of PostgreSQL data types for complex model properties.|<dl><dt>**json**</dt><dd>Generate `JSON` fields. Value is stored in `JSON` data type field as human-readable text. Value compliance with JSON standard is checked.</dd><dt>**jsonb**</dt><dd>Generate `JSONB` fields. Value is stored in `JSONB` data type field in binary format. `JSONB` data type is generally nore efficient than `JSON` but it is not human-readable. Value compliance with JSON standard is checked.</dd><dt>**off**</dt><dd>Generate `TEXT` fields. Just store the value as plain text. Value compliance with JSON standard is not checked.</dd></dl>|json|
|jsonDataType|Use of PostgreSQL data types for complex model properties.|<dl><dt>**json**</dt><dd>Generate `JSON` fields. Value is stored in `JSON` data type field as human-readable text. Value compliance with JSON standard is checked.</dd><dt>**jsonb**</dt><dd>Generate `JSONB` fields. Value is stored in `JSONB` data type field in binary format. `JSONB` data type is generally more efficient than `JSON` but it is not human-readable. Value compliance with JSON standard is checked.</dd><dt>**off**</dt><dd>Generate `TEXT` fields. Just store the value as plain text. Value compliance with JSON standard is not checked.</dd></dl>|json|
|namedParametersEnabled|Generates query examples with named variables in value placeholders (eg.`:name`,`:quantity`) if `true`. Otherwise, generates question marks `?` in value placeholders.| |false|

## IMPORT MAPPING
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/swift5.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: false).| |null|
|validatable|Make validation rules and validator for model properies (default: true)| |true|
|validatable|Make validation rules and validator for model properties (default: true)| |true|

## IMPORT MAPPING

Expand Down
2 changes: 1 addition & 1 deletion docs/generators/swift6.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: true).| |null|
|validatable|Make validation rules and validator for model properies (default: true)| |true|
|validatable|Make validation rules and validator for model properties (default: true)| |true|

## IMPORT MAPPING

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public class Generate extends OpenApiGeneratorCommand {

@Option(
name = {"--openapi-generator-ignore-list"},
title = ".openapi-generaotr-ignore list",
title = ".openapi-generator-ignore list",
description = "specifies entries in the .openapi-generator-ignore file relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml"
+ " You can also have multiple occurrences of this option.")
private List<String> openapiGeneratorIgnoreList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7915,7 +7915,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set<String> imports, S
if (original.getMinimum() != null) {
codegenParameter.setMinimum(String.valueOf(original.getMinimum().doubleValue()));
}
/* comment out below as we don't store `title` in the codegen parametera the moment
/* comment out below as we don't store `title` in the codegen parameter at the moment
if (original.getTitle() != null) {
codegenParameter.setTitle(original.getTitle());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private String getInlineSchemaName(HttpMethod httpVerb, String pathname) {

/**
* Return false if model can be represented by primitives e.g. string, object
* without properties, array or map of other model (model contanier), etc.
* without properties, array or map of other model (model container), etc.
* <p>
* Return true if a model should be generated e.g. object with properties,
* enum, oneOf, allOf, anyOf, etc.
Expand All @@ -220,7 +220,7 @@ private boolean isModelNeeded(Schema schema) {

/**
* Return false if model can be represented by primitives e.g. string, object
* without properties, array or map of other model (model contanier), etc.
* without properties, array or map of other model (model container), etc.
* <p>
* Return true if a model should be generated e.g. object with properties,
* enum, oneOf, allOf, anyOf, etc.
Expand Down Expand Up @@ -1043,7 +1043,7 @@ private void copyVendorExtensions(Schema source, Schema target) {
* Add the schemas to the components
*
* @param name name of the inline schema
* @param schema inilne schema
* @param schema inline schema
* @return the actual model name (based on inlineSchemaNameMapping if provided)
*/
private String addSchemas(String name, Schema schema) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ private Schema normalizeComplexComposedSchema(Schema schema, Set<Schema> visited
}

// ===================== a list of rules =====================
// all rules (functions ) start with the word "process"
// all rules (functions) start with the word "process"

/**
* Child schemas in `allOf` is considered a parent if it's a `$ref` (instead of inline schema).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ public ModelsMap postProcessModels(ModelsMap objs) {
}

// construct data tag in the template: x-go-datatag
// originl template
// original template
// `json:"{{{baseName}}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{{baseName}}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#withValidate}} validate:"{{validate}}"{{/withValidate}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
String goDataTag = "json:\"" + cp.baseName;
if (!cp.required) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ private boolean startsWithTwoUppercaseLetters(String name) {

@Override
public String toParamName(String name) {
// obtain the name from parameterNameMapping directly if provided
// obtain the name from parameterNameMapping directly if provided
if (parameterNameMapping.containsKey(name)) {
return parameterNameMapping.get(name);
}
Expand Down Expand Up @@ -1077,10 +1077,10 @@ private String getBeanValidation(Schema<?> items) {
}

if (items.get$ref() != null) {
Map<String, Schema> shemas = this.openAPI.getComponents().getSchemas();
Map<String, Schema> schemas = this.openAPI.getComponents().getSchemas();
String ref = ModelUtils.getSimpleRef(items.get$ref());
if (ref != null) {
Schema<?> schema = shemas.get(ref);
Schema<?> schema = schemas.get(ref);
if (schema == null || ModelUtils.isObjectSchema(schema)) {
return "@Valid ";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public String toVarName(String name) {
}

// translate @ for properties (like @type) to at_.
// Otherwise an additional "type" property will leed to duplcates
// Otherwise an additional "type" property will lead to duplicates
name = name.replaceAll("^@", "at_");

// sanitize name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ private PythonType stringType(IJsonSchemaValidationProperties cp) {
}
return pt;
} else {
if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead
if ("password".equals(cp.getFormat())) { // TODO avoid using format, use `is` boolean flag instead
moduleImports.add("pydantic", "SecretStr");
return new PythonType("SecretStr");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ private String getPydanticType(CodegenParameter cp,
pydanticImports.add("constr");
return String.format(Locale.ROOT, "constr(%s)", StringUtils.join(fieldCustomization, ", "));
} else {
if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead
if ("password".equals(cp.getFormat())) { // TODO avoid using format, use `is` boolean flag instead
pydanticImports.add("SecretStr");
return "SecretStr";
} else {
Expand Down Expand Up @@ -1375,7 +1375,7 @@ private String getPydanticType(CodegenProperty cp,
pydanticImports.add("constr");
return String.format(Locale.ROOT, "constr(%s)", StringUtils.join(fieldCustomization, ", "));
} else {
if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead
if ("password".equals(cp.getFormat())) { // TODO avoid using format, use `is` boolean flag instead
pydanticImports.add("SecretStr");
return "SecretStr";
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,10 @@ private void setIsFramework() {
additionalProperties.put(TARGET_FRAMEWORK, "netcoreapp" + aspnetCoreVersion);
}

setAddititonalPropertyForFramework();
setAdditionalPropertyForFramework();
}

private void setAddititonalPropertyForFramework() {
private void setAdditionalPropertyForFramework() {
String targetFramework = ((String)additionalProperties.get(TARGET_FRAMEWORK));
if (targetFramework.startsWith("net6.0") ||
targetFramework.startsWith("net7.0") ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ private void setAzureFunctionsVersion() {
//set .NET target version
String targetFrameworkVersion = "net" + netCoreVersion.getOptValue();
additionalProperties.put(TARGET_FRAMEWORK, targetFrameworkVersion);
setAddititonalPropertyForFramework();
setAdditionalPropertyForFramework();
}

private void setAddititonalPropertyForFramework() {
private void setAdditionalPropertyForFramework() {
if (((String)additionalProperties.get(TARGET_FRAMEWORK)).startsWith("net6.0")) {
additionalProperties.put(NET_60_OR_LATER, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ private String capitalizeFirstChar(String str) {
}

private String convertPathSegmentToResourceNamePart(String pathSegment) {
String convertedSegnemt = pathSegment;
String convertedSegment = pathSegment;
if (pathSegment.matches(OPEN_API_PATH_PARAM_PATTERN)) {
convertedSegnemt = pathSegment.substring(1, pathSegment.length() - 1);
convertedSegment = pathSegment.substring(1, pathSegment.length() - 1);
}
return capitalizeFirstChar(sanitizeName(convertedSegnemt));
return capitalizeFirstChar(sanitizeName(convertedSegment));
}

private String convertPathParamPattern(String pathSegment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ private boolean isKtor2Or3() {
/**
* Returns true if latest version of ktor is used.
*
* @return true if latest veresion of ktor is used.
* @return true if latest version of ktor is used.
*/
private boolean isKtor() {
return Constants.KTOR.equals(library);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public PostgresqlSchemaCodegen() {
"Use of PostgreSQL data types for complex model properties.");
jsonDataTypeOpt.addEnum("json", "Generate `JSON` fields. Value is stored in `JSON` data type field as human-readable text. Value compliance with JSON standard is checked.")
.addEnum("jsonb",
"Generate `JSONB` fields. Value is stored in `JSONB` data type field in binary format. `JSONB` data type is generally nore efficient than `JSON` but it is not human-readable. Value compliance with JSON standard is checked.")
"Generate `JSONB` fields. Value is stored in `JSONB` data type field in binary format. `JSONB` data type is generally more efficient than `JSON` but it is not human-readable. Value compliance with JSON standard is checked.")
.addEnum("off", "Generate `TEXT` fields. Just store the value as plain text. Value compliance with JSON standard is not checked.")
.setDefault("json");
cliOptions.add(jsonDataTypeOpt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public ParamPart(String name, CodegenParameter param) {
* {{{
*
* @cask.get("/user", subpath = true)
* def userRouteDescriminator(request: cask.Request) = {
* def userRouteDiscriminator(request: cask.Request) = {
* request.remainingPathSegments match {
* case Seq("logout") => logoutUser(request)
* case Seq("login") => loginUser(request)
Expand Down Expand Up @@ -758,7 +758,7 @@ private static boolean doesNotNeedMapping(final CodegenProperty p, final Set<Str
// ermph. Apparently 'isPrimitive' can be false while 'isNumeric' is true.

/*
* if dataType == Value then it doesn't need mapping -- this can happen with properties like ths:
* if dataType == Value then it doesn't need mapping -- this can happen with properties like this:
* {{{
* example:
* items: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs)
return modelsMap;
}

private Map<String, Object> makeRefiined(Set<String> imports, String dataType, ArrayList<String> refined) {
private Map<String, Object> makeRefined(Set<String> imports, String dataType, ArrayList<String> refined) {
Map<String, Object> vendorExtensions = new HashMap<>();
if (!refined.isEmpty()) {
imports.add("And");
Expand Down Expand Up @@ -426,7 +426,7 @@ private Map<String, Object> refineProp(IJsonSchemaValidationProperties prop, Set
} catch (IndexOutOfBoundsException ignored) {
}
}
vendorExtensions.putAll(makeRefiined(imports, prop.getDataType(), refined));
vendorExtensions.putAll(makeRefined(imports, prop.getDataType(), refined));
}

if ("Int".equals(prop.getDataType())
Expand Down Expand Up @@ -455,7 +455,7 @@ private Map<String, Object> refineProp(IJsonSchemaValidationProperties prop, Set
imports.add("LessEqual");
}
}
vendorExtensions.putAll(makeRefiined(imports, prop.getDataType(), refined));
vendorExtensions.putAll(makeRefined(imports, prop.getDataType(), refined));
}

if (prop.getIsUuid() || "Uuid".equals(prop.getDataType())) {
Expand All @@ -476,7 +476,7 @@ private Map<String, Object> refineProp(IJsonSchemaValidationProperties prop, Set
imports.add("MaxSize");
}

vendorExtensions.putAll(makeRefiined(imports, prop.getDataType(), refined));
vendorExtensions.putAll(makeRefined(imports, prop.getDataType(), refined));
}

return vendorExtensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public Swift5ClientCodegen() {
.defaultValue(Boolean.FALSE.toString()));

cliOptions.add(new CliOption(VALIDATABLE,
"Make validation rules and validator for model properies (default: true)")
"Make validation rules and validator for model properties (default: true)")
.defaultValue(Boolean.TRUE.toString()));

supportedLibraries.put(LIBRARY_URLSESSION, "[DEFAULT] HTTP client: URLSession");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public Swift6ClientCodegen() {
.defaultValue(Boolean.FALSE.toString()));

cliOptions.add(new CliOption(VALIDATABLE,
"Make validation rules and validator for model properies (default: true)")
"Make validation rules and validator for model properties (default: true)")
.defaultValue(Boolean.TRUE.toString()));

cliOptions.add(new CliOption(API_STATIC_METHOD,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ protected void addVendorExtensions(CodegenParameter cp, CodegenOperation operati
CodegenModel baseModel = modelMaps.get(cp.items.dataType);
boolean isBaseTypeEnum = cp.items.isEnum || cp.isEnum || (baseModel != null && baseModel.isEnum);
cp.vendorExtensions.put("x-swift-is-base-type-enum", isBaseTypeEnum);
boolean isBaseTypeUdid = cp.items.isUuid || cp.isUuid;
cp.vendorExtensions.put("x-swift-is-base-type-udid", isBaseTypeUdid);
boolean isBaseTypeUuid = cp.items.isUuid || cp.isUuid;
cp.vendorExtensions.put("x-swift-is-base-type-uuid", isBaseTypeUuid);

boolean useEncoder = !isBaseTypeEnum && !cp.items.isString || (baseModel != null && !baseModel.isString);
cp.vendorExtensions.put("x-swift-use-encoder", useEncoder);
Expand Down
Loading
Loading