mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Fix thousands of spelling typos (#10272)
This commit is contained in:
parent
2d239271e5
commit
5d68bd6a03
10
.github/.test/js-yaml.js
vendored
10
.github/.test/js-yaml.js
vendored
@ -1811,7 +1811,7 @@ function readBlockScalar(state, nodeIndent) {
|
||||
}
|
||||
}
|
||||
|
||||
// Break this `while` cycle and go to the funciton's epilogue.
|
||||
// Break this `while` cycle and go to the function's epilogue.
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2862,7 +2862,7 @@ module.exports = new Schema({
|
||||
//
|
||||
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
|
||||
// So, this schema is not such strict as defined in the YAML specification.
|
||||
// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
|
||||
// It allows numbers in binary notation, use `Null` and `NULL` as `null`, etc.
|
||||
|
||||
|
||||
'use strict';
|
||||
@ -3222,7 +3222,7 @@ function representYamlFloat(object, style) {
|
||||
res = object.toString(10);
|
||||
|
||||
// JS stringifier can build scientific format without dots: 5e-100,
|
||||
// while YAML requres dot: 5.e-100. Fix it with simple hack
|
||||
// while YAML requires dot: 5.e-100. Fix it with simple hack
|
||||
|
||||
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
|
||||
}
|
||||
@ -3424,7 +3424,7 @@ var esprima;
|
||||
// Browserified version does not have esprima
|
||||
//
|
||||
// 1. For node.js just require module as deps
|
||||
// 2. For browser try to require mudule via external AMD system.
|
||||
// 2. For browser try to require module via external AMD system.
|
||||
// If not found - try to fallback to window.esprima. If not
|
||||
// found too - then fail to parse.
|
||||
//
|
||||
@ -3881,7 +3881,7 @@ function constructYamlTimestamp(data) {
|
||||
if (match[9]) {
|
||||
tz_hour = +(match[10]);
|
||||
tz_minute = +(match[11] || 0);
|
||||
delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
|
||||
delta = (tz_hour * 60 + tz_minute) * 60000; // delta in milliseconds
|
||||
if (match[9] === '-') delta = -delta;
|
||||
}
|
||||
|
||||
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -18,7 +18,7 @@ scripts/**/* @jimschubert
|
||||
website/**/* @jimschubert
|
||||
bin/ci/**/* @jimschubert
|
||||
|
||||
## Bulid related
|
||||
## Build related
|
||||
CI/**/* @OpenAPITools/build
|
||||
.mvn/**/* @OpenAPITools/build
|
||||
bin/utils/**/* @OpenAPITools/build
|
||||
|
@ -126,7 +126,7 @@ before_install:
|
||||
# -- skip perl test to shorten build time
|
||||
# perl dep
|
||||
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
|
||||
#- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Igorned failure from cpanm"
|
||||
#- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Ignored failure from cpanm"
|
||||
# -- skip perl test end
|
||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||
- cat /etc/hosts
|
||||
|
@ -95,7 +95,7 @@ test_script:
|
||||
# generate all petstore clients (openapi3)
|
||||
# - .\bin\openapi3\windows\run-all-petstore.cmd
|
||||
|
||||
# test ps pestore
|
||||
# test ps petstore
|
||||
- ps: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
cd samples\client\petstore\powershell\
|
||||
|
@ -17,4 +17,4 @@ The last Dart version that was used to generate the keywords can be found in `da
|
||||
1. run the dart app
|
||||
- `./save-dart-keywords.exe`
|
||||
|
||||
1. the ouput is `dart-keywords.txt` and `dart-version.txt`
|
||||
1. the output is `dart-keywords.txt` and `dart-version.txt`
|
||||
|
@ -26,7 +26,7 @@ if [[ "--skip-docs" == "${1}" ]]; then
|
||||
export SKIP_EXPORT_DOCS=true
|
||||
fi
|
||||
|
||||
# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)
|
||||
# Some special case generators may expect to be run as a standalone process (e.g. modifying classpath)
|
||||
# Docs should always be run, regardless of batch or operation.
|
||||
declare -a always_iterate=(
|
||||
"${root}/bin/meta-codegen.sh"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# release_chekcout.rb
|
||||
# release_checkout.rb
|
||||
#
|
||||
require 'rubygems'
|
||||
require 'open-uri'
|
||||
@ -37,7 +37,7 @@ def check_npmjs
|
||||
end
|
||||
|
||||
def check_homebrew
|
||||
print "Checking homebrew forumla ... "
|
||||
print "Checking homebrew formula ... "
|
||||
|
||||
url = "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/openapi-generator.rb"
|
||||
new_maven_url = "https://search.maven.org/remotecontent?filepath=org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar"
|
||||
|
@ -104,7 +104,7 @@ sidebar_label: "Release Notes: 3.0.0"
|
||||
* 39fa375e3 \[kotlin] Fix NPE for POST/PUT/PATCH with empty request models.
|
||||
* c599906f1 Kotlin: Correct data_class.mustache to use proper property for inner enum data type
|
||||
* c69925b53 \[Kotlin] Fix issues with threetenbp
|
||||
* a811a48c3 minor fix to kotlin client genrator due to merge conflict
|
||||
* a811a48c3 minor fix to kotlin client generator due to merge conflict
|
||||
* 914275fe7 \[kotlin] support selection of datelibrary
|
||||
* a61d23265 Fixed incorrect renaming of header and query param to camel cases for Kotlin Client template
|
||||
|
||||
@ -141,7 +141,7 @@ sidebar_label: "Release Notes: 3.0.0"
|
||||
* 82ee8656f \[java] Enum in array of array (#66)
|
||||
* bf7e4e7df Java gson: add @SerializedName value as constant (#22)
|
||||
* 30c1448d7 Fix build.gradle for Java RESTEasy client
|
||||
* 642c0566d \[Java] Use Rx2 Completalbe for Void Retrofit2 responses
|
||||
* 642c0566d \[Java] Use Rx2 Completable for Void Retrofit2 responses
|
||||
* 72221b1cf Adding @Deprecated to retrofit2 client interfaces.
|
||||
* 47111b324 \[Java] fix gson deserialize format byte
|
||||
* 9e06f7063 \[Java] Fix assignment of new object instance to variable
|
||||
@ -183,7 +183,7 @@ sidebar_label: "Release Notes: 3.0.0"
|
||||
* 61e58d649 Add R namespace file
|
||||
|
||||
* ### Ruby
|
||||
* a08164592 fix ruby parameters in documentation, fix reuqiredParams, optionalParams
|
||||
* a08164592 fix ruby parameters in documentation, fix requiredParams, optionalParams
|
||||
* 8e34f9a98 update to newer version of ruby
|
||||
* aa6b217bb \[Ruby] Add auto-generated rubocop config file
|
||||
|
||||
@ -238,15 +238,15 @@ sidebar_label: "Release Notes: 3.0.0"
|
||||
* 866817587 \[aspnetcore] Fix string enum generation
|
||||
|
||||
* ### Java
|
||||
* bd50d368e \[JAVA - jaxrs-reasteasy-eap] Add import to models (#179)
|
||||
* bd50d368e \[JAVA - jaxrs-resteasy-eap] Add import to models (#179)
|
||||
* 7efda597c Fix issue with useBeanValidation option in Java server generators (#160)
|
||||
* 71b5de3ed Do not set contextPath for spring-boot (#104)
|
||||
* b73ab0260 jaxrs-cxf-cdi: fix outer enum (#131)
|
||||
* 4d7fc046f \[JaxRS] Add "validation-api" dependency in jetty (#30)
|
||||
* ce930e7a6 \[Jaxrs-cxf] Add bean-level cascaded beanvalidation for pojos (@Valid)
|
||||
* 386b9f432 Modify "postProcessOperations" for "jaxrs-cxf-client"
|
||||
* 5d92717dc update jaxrs to listent at port 10080
|
||||
* 7c2031675 update artifict id for jaxrs datelib j8
|
||||
* 5d92717dc update jaxrs to listen at port 10080
|
||||
* 7c2031675 update artifact id for jaxrs datelib j8
|
||||
* 88c5112f2 Adds support for returning response in jaxrs-spec interfaces
|
||||
* 6bf84d5fa \[JAXRS-SPEC] Fix lowercase enums sent as uppercase
|
||||
* 3a1922bc9 Fix version for "spring-boot-maven-plugin" (#85)
|
||||
@ -329,7 +329,7 @@ sidebar_label: "Release Notes: 3.0.0"
|
||||
* 1492df6ce Override server port for Jetty configuration
|
||||
* 622a75b2c Fix data type shadowing
|
||||
* 861d11d01 use vendor extension in operation to set the body parameter name
|
||||
* 80c8b92cb add postProcessParamter for body, form parameter
|
||||
* 80c8b92cb add postProcessParameter for body, form parameter
|
||||
* 7fe555a51 Set collectionFormat default only for array
|
||||
* 16589de97 default collection format to csv according to the spec
|
||||
* edbe4902a Consider '$ref' for consumes and produces in CodegenOperation
|
||||
|
@ -360,7 +360,7 @@ import org.openapitools.codegen.languages.*;
|
||||
|
||||
public class MyObjcCodegen extends ObjcClientCodegen {
|
||||
static {
|
||||
PREFIX = "HELO";
|
||||
PREFIX = "HELLO";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -5,7 +5,7 @@ title: "FAQ: General"
|
||||
|
||||
## Do you have a chat room?
|
||||
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM)
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM)
|
||||
|
||||
## What is the governance structure of the OpenAPI Generator project?
|
||||
|
||||
|
@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|groupId|groupId for use in the generated build.gradle and pom.xml| |null|
|
||||
|invokerPackage|root package for generated code| |null|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|library|library template (sub-template) to use|<dl><dt>**volley**</dt><dd>HTTP client: Volley 1.0.19 (default)</dd><dt>**httpclient**</dt><dd>HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be depecreated in the next major release.</dd></dl>|null|
|
||||
|library|library template (sub-template) to use|<dl><dt>**volley**</dt><dd>HTTP client: Volley 1.0.19 (default)</dd><dt>**httpclient**</dt><dd>HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be deprecated in the next major release.</dd></dl>|null|
|
||||
|modelPackage|package for generated models| |null|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|
|
||||
|
@ -14,7 +14,7 @@ sidebar_label: go-experimental
|
||||
|packageVersion|Go package version.| |1.0.0|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
|
||||
|skipReadonlyPropertiesInInt|Skip default values to the readOnly properties in the model init function./ /false/
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support| |false|
|
||||
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default in GitHub PRs and diffs| |false|
|
||||
|
@ -36,7 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|invokerPackage|root package for generated code| |org.openapitools.client|
|
||||
|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd></dl>|true|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 1.x. JSON processing: JSON-B</dd><dt>**apache-httpclient**</dt><dd>HTTP client: Apache httpclient 4.x</dd></dl>|okhttp-gson|
|
||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 1.x. JSON processing: JSON-B</dd><dt>**apache-httpclient**</dt><dd>HTTP client: Apache httpclient 4.x</dd></dl>|okhttp-gson|
|
||||
|licenseName|The name of the license| |Unlicense|
|
||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
||||
|
@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
|
||||
|packageName|Generated artifact package name.| |org.openapitools.client|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|<dl><dt>**toJson**</dt><dd>[DEFAULT] Date formater option using a json converter.</dd><dt>**toString**</dt><dd>Use the 'toString'-method of the date-time object to retrieve the related string representation.</dd></dl>|toJson|
|
||||
|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|<dl><dt>**toJson**</dt><dd>[DEFAULT] Date formatter option using a json converter.</dd><dt>**toString**</dt><dd>Use the 'toString'-method of the date-time object to retrieve the related string representation.</dd></dl>|toJson|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
||||
|
@ -166,7 +166,7 @@ You don't need to rename the file manually, OpenAPI Generator will do it when yo
|
||||
|
||||
## Metadata folder
|
||||
|
||||
The metatata folder (to store the `VERSION` file for example) is now called `.openapi-generator/` instead of `.swagger-codegen/`.
|
||||
The metadata folder (to store the `VERSION` file for example) is now called `.openapi-generator/` instead of `.swagger-codegen/`.
|
||||
|
||||
|
||||
|
||||
|
@ -563,7 +563,7 @@ For C-like languages which also require header files, you may create two files p
|
||||
apiTemplateFiles.put("api-header.mustache", ".h");
|
||||
apiTemplateFiles.put("api-body.mustache", ".m");
|
||||
```
|
||||
Here, an Operation with tag `Pet` will generate two files: `SWGPetApi.h` and `SWGPetApi.m`. The `SWG` prefix and `Api` suffix are options specific to the Objective-C geneator.
|
||||
Here, an Operation with tag `Pet` will generate two files: `SWGPetApi.h` and `SWGPetApi.m`. The `SWG` prefix and `Api` suffix are options specific to the Objective-C generator.
|
||||
|
||||
### Models
|
||||
|
||||
|
@ -62,7 +62,7 @@ public interface TemplatingEngineAdapter {
|
||||
* @param bundle The map of values to pass to the template
|
||||
* @param templateFile The name of the template (e.g. model.mustache )
|
||||
* @return the processed template result
|
||||
* @throws IOException an error ocurred in the template processing
|
||||
* @throws IOException an error occurred in the template processing
|
||||
*/
|
||||
String compileTemplate(TemplatingExecutor executor, Map<String, Object> bundle,
|
||||
String templateFile) throws IOException;
|
||||
|
@ -54,7 +54,7 @@ public class ValidationRule {
|
||||
}
|
||||
|
||||
/**
|
||||
* Evalute an instance of an object against this rule.
|
||||
* Evaluate an instance of an object against this rule.
|
||||
*
|
||||
* @param input The instance to be evaluated.
|
||||
*
|
||||
|
@ -677,7 +677,7 @@ You can run `gradle tasks --debug` to see this registration.
|
||||
|
||||
=== Android Studio
|
||||
|
||||
Android Studio may experience a Windows-specific Guava dependency conflict with openapig-enerator-gradle-plugin versions greater than 3.0.0.
|
||||
Android Studio may experience a Windows-specific Guava dependency conflict with openapi-generator-gradle-plugin versions greater than 3.0.0.
|
||||
|
||||
As a workaround, you may force exclude conflicting Guava dependencies.
|
||||
|
||||
|
@ -80,7 +80,7 @@ test {
|
||||
failFast = true
|
||||
|
||||
onOutput { descriptor, event ->
|
||||
// SLF4J may complain about multiple bindings dependign on how this is run.
|
||||
// SLF4J may complain about multiple bindings depending on how this is run.
|
||||
// This is just a warning, but can make test output less readable. So we ignore it specifically.
|
||||
if (!event.message.contains("SLF4J:")) {
|
||||
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message)
|
||||
|
@ -7,11 +7,11 @@ First, publish the openapi-generator-gradle-plugin locally via `./gradlew assemb
|
||||
Then, run the following tasks in this example directory.
|
||||
|
||||
```bash
|
||||
gradle openApiGenerate # expected outcome: BUILD SCCESSFUL
|
||||
gradle openApiMeta # expected outcome: BUILD SCCESSFUL
|
||||
gradle openApiGenerate # expected outcome: BUILD SUCCESSFUL
|
||||
gradle openApiMeta # expected outcome: BUILD SUCCESSFUL
|
||||
gradle openApiValidate # expected outcome: BUILD FAILED
|
||||
gradle buildGoSdk # expected outcome: BUILD SCCESSFUL
|
||||
gradle buildDotnetSdk # expected outcome: BUILD SCCESSFUL
|
||||
gradle buildGoSdk # expected outcome: BUILD SUCCESSFUL
|
||||
gradle buildDotnetSdk # expected outcome: BUILD SUCCESSFUL
|
||||
gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
|
||||
```
|
||||
|
||||
|
@ -127,7 +127,7 @@
|
||||
<version>${swagger-annotations-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- You can find the dependencies for the library configuation you chose by looking in JavaClientCodegen.
|
||||
<!-- You can find the dependencies for the library configuration you chose by looking in JavaClientCodegen.
|
||||
Then find the corresponding dependency on Maven Central, and set the versions in the property section below -->
|
||||
|
||||
<!-- HTTP client: jersey-client -->
|
||||
|
@ -81,7 +81,7 @@
|
||||
<version>${swagger-annotations-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- You can find the dependencies for the library configuation you chose by looking in JavaClientCodegen.
|
||||
<!-- You can find the dependencies for the library configuration you chose by looking in JavaClientCodegen.
|
||||
Then find the corresponding dependency on Maven Central, and set the versions in the property section below -->
|
||||
|
||||
<!-- HTTP client: jersey-client -->
|
||||
|
@ -478,7 +478,7 @@ paths:
|
||||
X-Expires-After:
|
||||
type: "string"
|
||||
format: "date-time"
|
||||
description: "date in UTC when toekn expires"
|
||||
description: "date in UTC when token expires"
|
||||
400:
|
||||
description: "Invalid username/password supplied"
|
||||
/user/logout:
|
||||
|
@ -78,7 +78,7 @@
|
||||
<version>${swagger-annotations-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- You can find the dependencies for the library configuation you chose by looking in JavaClientCodegen.
|
||||
<!-- You can find the dependencies for the library configuration you chose by looking in JavaClientCodegen.
|
||||
Then find the corresponding dependency on Maven Central, and set the versions in the property section below -->
|
||||
|
||||
<dependency>
|
||||
|
@ -478,7 +478,7 @@ paths:
|
||||
X-Expires-After:
|
||||
type: "string"
|
||||
format: "date-time"
|
||||
description: "date in UTC when toekn expires"
|
||||
description: "date in UTC when token expires"
|
||||
400:
|
||||
description: "Invalid username/password supplied"
|
||||
/user/logout:
|
||||
|
@ -637,7 +637,7 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.toString());
|
||||
|
||||
if (configOptions != null) {
|
||||
// Retained for backwards-compataibility with configOptions -> instantiation-types
|
||||
// Retained for backwards-compatibility with configOptions -> instantiation-types
|
||||
if (instantiationTypes == null && configOptions.containsKey("instantiation-types")) {
|
||||
applyInstantiationTypesKvp(configOptions.get("instantiation-types").toString(),
|
||||
configurator);
|
||||
@ -649,18 +649,18 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
configurator);
|
||||
}
|
||||
|
||||
// Retained for backwards-compataibility with configOptions -> type-mappings
|
||||
// Retained for backwards-compatibility with configOptions -> type-mappings
|
||||
if (typeMappings == null && configOptions.containsKey("type-mappings")) {
|
||||
applyTypeMappingsKvp(configOptions.get("type-mappings").toString(), configurator);
|
||||
}
|
||||
|
||||
// Retained for backwards-compataibility with configOptions -> language-specific-primitives
|
||||
// Retained for backwards-compatibility with configOptions -> language-specific-primitives
|
||||
if (languageSpecificPrimitives == null && configOptions.containsKey("language-specific-primitives")) {
|
||||
applyLanguageSpecificPrimitivesCsv(configOptions
|
||||
.get("language-specific-primitives").toString(), configurator);
|
||||
}
|
||||
|
||||
// Retained for backwards-compataibility with configOptions -> additional-properties
|
||||
// Retained for backwards-compatibility with configOptions -> additional-properties
|
||||
if (additionalProperties == null && configOptions.containsKey("additional-properties")) {
|
||||
applyAdditionalPropertiesKvp(configOptions.get("additional-properties").toString(),
|
||||
configurator);
|
||||
@ -670,7 +670,7 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
applyServerVariablesKvp(configOptions.get("server-variables").toString(), configurator);
|
||||
}
|
||||
|
||||
// Retained for backwards-compataibility with configOptions -> reserved-words-mappings
|
||||
// Retained for backwards-compatibility with configOptions -> reserved-words-mappings
|
||||
if (reservedWordsMappings == null && configOptions.containsKey("reserved-words-mappings")) {
|
||||
applyReservedWordsMappingsKvp(configOptions.get("reserved-words-mappings")
|
||||
.toString(), configurator);
|
||||
|
@ -465,7 +465,7 @@ paths:
|
||||
type: integer
|
||||
format: int32
|
||||
X-Expires-After:
|
||||
description: date in UTC when toekn expires
|
||||
description: date in UTC when token expires
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
|
@ -465,7 +465,7 @@ paths:
|
||||
type: integer
|
||||
format: int32
|
||||
X-Expires-After:
|
||||
description: date in UTC when toekn expires
|
||||
description: date in UTC when token expires
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!doctype html> <!-- Important: must specify -->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
|
||||
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
|
||||
<script src="rapidoc-min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -207,7 +207,7 @@
|
||||
<groupId>se.bjurr.violations</groupId>
|
||||
<artifactId>violations-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- Should be decreased continuousle as issues are fixed, and will eventually
|
||||
<!-- Should be decreased continuously as issues are fixed, and will eventually
|
||||
reach 0. -->
|
||||
<maxViolations>65</maxViolations>
|
||||
</configuration>
|
||||
|
@ -229,7 +229,7 @@ public interface CodegenConfig {
|
||||
/**
|
||||
* Library template (sub-template).
|
||||
*
|
||||
* @return libray template
|
||||
* @return library template
|
||||
*/
|
||||
String getLibrary();
|
||||
|
||||
|
@ -928,7 +928,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// remove \t, \n, \r
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// outer unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
return escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
@ -954,7 +954,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// remove \t
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// outer unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
return escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
@ -1331,7 +1331,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
/**
|
||||
* Return the variable name in the Api
|
||||
*
|
||||
* @param name the varible name of the Api
|
||||
* @param name the variable name of the Api
|
||||
* @return the snake-cased variable name
|
||||
*/
|
||||
@Override
|
||||
@ -2317,7 +2317,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
/**
|
||||
* Converts the OpenAPI schema name to a model name suitable for the current code generator.
|
||||
* May be overriden for each programming language.
|
||||
* May be overridden for each programming language.
|
||||
* In case the name belongs to the TypeSystem it won't be renamed.
|
||||
*
|
||||
* @param name the name of the model
|
||||
@ -2453,7 +2453,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
final List<String> allParents = ModelUtils.getAllParentsName(composed, allDefinitions, false);
|
||||
final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName);
|
||||
|
||||
// TODO revise the logic below to set dicriminator, xml attributes
|
||||
// TODO revise the logic below to set discriminator, xml attributes
|
||||
if (supportsInheritance || supportsMixins) {
|
||||
m.allVars = new ArrayList<CodegenProperty>();
|
||||
if (composed.getAllOf() != null) {
|
||||
@ -3851,13 +3851,13 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// remove prefix in operationId
|
||||
if (removeOperationIdPrefix) {
|
||||
// The prefix is everything before the removeOperationIdPrefixCount occurrence of removeOperationIdPrefixDelimiter
|
||||
String[] componenets = operationId.split("[" + removeOperationIdPrefixDelimiter + "]");
|
||||
if (componenets.length > 1) {
|
||||
String[] components = operationId.split("[" + removeOperationIdPrefixDelimiter + "]");
|
||||
if (components.length > 1) {
|
||||
// If removeOperationIdPrefixCount is -1 or bigger that the number of occurrences, uses the last one
|
||||
int componenet_number = removeOperationIdPrefixCount == -1 ? componenets.length - 1 : removeOperationIdPrefixCount;
|
||||
componenet_number = Math.min(componenet_number, componenets.length - 1);
|
||||
int component_number = removeOperationIdPrefixCount == -1 ? components.length - 1 : removeOperationIdPrefixCount;
|
||||
component_number = Math.min(component_number, components.length - 1);
|
||||
// Reconstruct the operationId from its split elements and the delimiter
|
||||
operationId = String.join(removeOperationIdPrefixDelimiter, Arrays.copyOfRange(componenets, componenet_number, componenets.length));
|
||||
operationId = String.join(removeOperationIdPrefixDelimiter, Arrays.copyOfRange(components, component_number, components.length));
|
||||
}
|
||||
}
|
||||
operationId = removeNonNameElementToCamelCase(operationId);
|
||||
@ -4947,7 +4947,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop through propertiies and unalias the reference if $ref (reference) is defined
|
||||
* Loop through properties and unalias the reference if $ref (reference) is defined
|
||||
*
|
||||
* @param properties model properties (schemas)
|
||||
* @return model properties with direct reference to schemas
|
||||
@ -6022,7 +6022,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else {
|
||||
LOGGER.warn("Could not compute datatypeWithEnum from {}, {}", codegenParameter.baseType, codegenParameter.enumName);
|
||||
}
|
||||
//TODO fix collectformat for form parameters
|
||||
//TODO fix collectionFormat for form parameters
|
||||
//collectionFormat = getCollectionFormat(s);
|
||||
String collectionFormat = getCollectionFormat(codegenParameter);
|
||||
// default to csv:
|
||||
@ -6577,7 +6577,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Boolean value indicating the state of the option for post-processing file using envirionment variables.
|
||||
* Boolean value indicating the state of the option for post-processing file using environment variables.
|
||||
*
|
||||
* @return true if the option is enabled
|
||||
*/
|
||||
@ -6587,7 +6587,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the boolean value indicating the state of the option for post-processing file using envirionment variables.
|
||||
* Set the boolean value indicating the state of the option for post-processing file using environment variables.
|
||||
*
|
||||
* @param enablePostProcessFile true to enable post-processing file
|
||||
*/
|
||||
|
@ -458,7 +458,7 @@ public class DefaultGenerator implements Generator {
|
||||
|
||||
Schema schema = schemas.get(name);
|
||||
|
||||
if (ModelUtils.isFreeFormObject(this.openAPI, schema)) { // check to see if it'a a free-form object
|
||||
if (ModelUtils.isFreeFormObject(this.openAPI, schema)) { // check to see if it's a free-form object
|
||||
// there are 3 free form use cases
|
||||
// 1. free form with no validation that is not allOf included in any composed schemas
|
||||
// 2. free form with validation
|
||||
@ -1320,8 +1320,8 @@ public class DefaultGenerator implements Generator {
|
||||
if (securityScheme != null) {
|
||||
|
||||
if (securityScheme.getType().equals(SecurityScheme.Type.OAUTH2)) {
|
||||
OAuthFlows oautUpdatedFlows = new OAuthFlows();
|
||||
oautUpdatedFlows.extensions(securityScheme.getFlows().getExtensions());
|
||||
OAuthFlows oauthUpdatedFlows = new OAuthFlows();
|
||||
oauthUpdatedFlows.extensions(securityScheme.getFlows().getExtensions());
|
||||
|
||||
SecurityScheme oauthUpdatedScheme = new SecurityScheme()
|
||||
.type(securityScheme.getType())
|
||||
@ -1333,7 +1333,7 @@ public class DefaultGenerator implements Generator {
|
||||
.bearerFormat(securityScheme.getBearerFormat())
|
||||
.openIdConnectUrl(securityScheme.getOpenIdConnectUrl())
|
||||
.extensions(securityScheme.getExtensions())
|
||||
.flows(oautUpdatedFlows);
|
||||
.flows(oauthUpdatedFlows);
|
||||
|
||||
// Ensure inserted AuthMethod only contains scopes of actual operation, and not all of them defined in the Security Component
|
||||
// have to iterate through and create new SecurityScheme objects with the scopes 'fixed/updated'
|
||||
@ -1343,22 +1343,22 @@ public class DefaultGenerator implements Generator {
|
||||
if (securitySchemeFlows.getAuthorizationCode() != null) {
|
||||
OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getAuthorizationCode(), entry.getValue());
|
||||
|
||||
oautUpdatedFlows.setAuthorizationCode(updatedFlow);
|
||||
oauthUpdatedFlows.setAuthorizationCode(updatedFlow);
|
||||
}
|
||||
if (securitySchemeFlows.getImplicit() != null) {
|
||||
OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getImplicit(), entry.getValue());
|
||||
|
||||
oautUpdatedFlows.setImplicit(updatedFlow);
|
||||
oauthUpdatedFlows.setImplicit(updatedFlow);
|
||||
}
|
||||
if (securitySchemeFlows.getPassword() != null) {
|
||||
OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getPassword(), entry.getValue());
|
||||
|
||||
oautUpdatedFlows.setPassword(updatedFlow);
|
||||
oauthUpdatedFlows.setPassword(updatedFlow);
|
||||
}
|
||||
if (securitySchemeFlows.getClientCredentials() != null) {
|
||||
OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getClientCredentials(), entry.getValue());
|
||||
|
||||
oautUpdatedFlows.setClientCredentials(updatedFlow);
|
||||
oauthUpdatedFlows.setClientCredentials(updatedFlow);
|
||||
}
|
||||
|
||||
authMethods.put(key, oauthUpdatedScheme);
|
||||
|
@ -80,7 +80,7 @@ public class ExampleGenerator {
|
||||
|
||||
if (ModelUtils.isArraySchema(responseSchema)) { // array of schema
|
||||
ArraySchema as = (ArraySchema) responseSchema;
|
||||
if (as.getItems() != null && StringUtils.isEmpty(as.getItems().get$ref())) { // arary of primtive types
|
||||
if (as.getItems() != null && StringUtils.isEmpty(as.getItems().get$ref())) { // array of primitive types
|
||||
return generate((Map<String, Object>) responseSchema.getExample(),
|
||||
new ArrayList<String>(producesInfo), as.getItems());
|
||||
} else if (as.getItems() != null && !StringUtils.isEmpty(as.getItems().get$ref())) { // array of model
|
||||
@ -90,7 +90,7 @@ public class ExampleGenerator {
|
||||
// TODO log warning message as such case is not handled at the moment
|
||||
return null;
|
||||
}
|
||||
} else if (StringUtils.isEmpty(responseSchema.get$ref())) { // primtiive type (e.g. integer, string)
|
||||
} else if (StringUtils.isEmpty(responseSchema.get$ref())) { // primitive type (e.g. integer, string)
|
||||
return generate((Map<String, Object>) responseSchema.getExample(),
|
||||
new ArrayList<String>(producesInfo), responseSchema);
|
||||
} else { // model
|
||||
|
@ -96,7 +96,7 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code
|
||||
name = "_u";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
if (isReservedWord(name)) {
|
||||
name = escapeReservedWord(name);
|
||||
@ -600,15 +600,15 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
|
@ -560,7 +560,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
model.vendorExtensions.put("x-enum-string", true);
|
||||
}
|
||||
|
||||
// Since we iterate enumVars for modelnnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties,
|
||||
// Since we iterate enumVars for modelInnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties,
|
||||
// we can take advantage of Mustache's contextual lookup to add the same "properties" to the model's enumVars scope rather than CodegenProperty's scope.
|
||||
List<Map<String, String>> enumVars = (ArrayList<Map<String, String>>) model.allowableValues.get("enumVars");
|
||||
List<Map<String, Object>> newEnumVars = new ArrayList<Map<String, Object>>();
|
||||
@ -837,7 +837,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
// sanitize name
|
||||
name = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -866,7 +866,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = name.replaceAll("-", "_");
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name.replaceAll("-", "_"));
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -304,32 +304,32 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
|
||||
|
||||
// Not using the supertype invocation, because we want to UpperCamelize
|
||||
// the type.
|
||||
String scheamType = getSchemaType(p);
|
||||
if (typeMapping.containsKey(scheamType)) {
|
||||
return typeMapping.get(scheamType);
|
||||
String schemaType = getSchemaType(p);
|
||||
if (typeMapping.containsKey(schemaType)) {
|
||||
return typeMapping.get(schemaType);
|
||||
}
|
||||
|
||||
if (typeMapping.containsValue(scheamType)) {
|
||||
return scheamType;
|
||||
if (typeMapping.containsValue(schemaType)) {
|
||||
return schemaType;
|
||||
}
|
||||
|
||||
if (languageSpecificPrimitives.contains(scheamType)) {
|
||||
return scheamType;
|
||||
if (languageSpecificPrimitives.contains(schemaType)) {
|
||||
return schemaType;
|
||||
}
|
||||
|
||||
return toModelName(scheamType);
|
||||
return toModelName(schemaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemaType(Schema p) {
|
||||
String scheamType = super.getSchemaType(p);
|
||||
String schemaType = super.getSchemaType(p);
|
||||
String type = null;
|
||||
if (typeMapping.containsKey(scheamType)) {
|
||||
type = typeMapping.get(scheamType);
|
||||
if (typeMapping.containsKey(schemaType)) {
|
||||
type = typeMapping.get(schemaType);
|
||||
if (languageSpecificPrimitives.contains(type))
|
||||
return (type);
|
||||
} else
|
||||
type = scheamType;
|
||||
type = schemaType;
|
||||
return type;
|
||||
}
|
||||
|
||||
@ -518,15 +518,15 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
|
@ -346,7 +346,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
||||
|
||||
/*
|
||||
* F# does not allow forward declarations, so files must be imported in the correct order.
|
||||
* Output of CodeGen models must therefore bein dependency order (rather than alphabetical order, which seems to be the default).
|
||||
* Output of CodeGen models must therefore be in dependency order (rather than alphabetical order, which seems to be the default).
|
||||
* This could probably be made more efficient if absolutely needed.
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@ -452,7 +452,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
||||
model.vendorExtensions.put("x-enum-string", true);
|
||||
}
|
||||
|
||||
// Since we iterate enumVars for modelnnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties,
|
||||
// Since we iterate enumVars for modelInnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties,
|
||||
// we can take advantage of Mustache's contextual lookup to add the same "properties" to the model's enumVars scope rather than CodegenProperty's scope.
|
||||
List<Map<String, String>> enumVars = (ArrayList<Map<String, String>>) model.allowableValues.get("enumVars");
|
||||
List<Map<String, Object>> newEnumVars = new ArrayList<Map<String, Object>>();
|
||||
@ -679,7 +679,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
||||
// sanitize name
|
||||
name = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -701,7 +701,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = name.replaceAll("-", "_");
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
return name;
|
||||
|
||||
@ -420,7 +420,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
* <p>
|
||||
* Note the 'parent' attribute in the codegen model is used in the following scenarios:
|
||||
* - Indicate a polymorphic association with some other type (e.g. class inheritance).
|
||||
* - If the specification has a discriminator, cogegen create a “parent” based on the discriminator.
|
||||
* - If the specification has a discriminator, codegen create a “parent” based on the discriminator.
|
||||
* - Use of the 'additionalProperties' attribute in the OAS specification.
|
||||
* This is the specific scenario when codegen invokes this function.
|
||||
*
|
||||
|
@ -153,7 +153,7 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name.replaceAll("-", "_"));
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
return name;
|
||||
|
||||
|
@ -756,7 +756,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
name = "_" + name;
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z0-9_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -1529,15 +1529,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
@ -1942,7 +1942,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
@Override
|
||||
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
||||
if (!supportsAdditionalPropertiesWithComposedSchema) {
|
||||
// The additional (undeclared) propertiees are modeled in Java as a HashMap.
|
||||
// The additional (undeclared) properties are modeled in Java as a HashMap.
|
||||
//
|
||||
// 1. supportsAdditionalPropertiesWithComposedSchema is set to false:
|
||||
// The generated model class extends from the HashMap. That does not work
|
||||
|
@ -61,7 +61,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
|
||||
apiPackage = "org.openapitools.api";
|
||||
modelPackage = "org.openapitools.model";
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||
|
@ -881,7 +881,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
name = "_u";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z0-9_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -441,7 +441,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
||||
public String toModelName(String name) {
|
||||
name = toGenericName(name);
|
||||
|
||||
// add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime)
|
||||
// add prefix and/or suffix only if name does not start wth \ (e.g. \DateTime)
|
||||
if (!name.matches("^\\\\.*")) {
|
||||
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||
name = modelNamePrefix + "_" + name;
|
||||
|
@ -188,7 +188,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
||||
// remove dollar sign
|
||||
name = name.replaceAll("$", "");
|
||||
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
name = name.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
}
|
||||
if (!fixedPath.equals(pathname)) {
|
||||
LOGGER.warn(
|
||||
"Path '{}' is not consistant with Python variable names. It will be replaced by '{}'",
|
||||
"Path '{}' is not consistent with Python variable names. It will be replaced by '{}'",
|
||||
pathname, fixedPath);
|
||||
paths.remove(pathname);
|
||||
path.addExtension("x-python-connexion-openapi-name", pathname);
|
||||
@ -376,7 +376,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
String pythonParameterName = this.toParamName(swaggerParameterName);
|
||||
if (!swaggerParameterName.equals(pythonParameterName)) {
|
||||
LOGGER.warn(
|
||||
"Parameter name '{}' is not consistant with Python variable names. It will be replaced by '{}'",
|
||||
"Parameter name '{}' is not consistent with Python variable names. It will be replaced by '{}'",
|
||||
swaggerParameterName, pythonParameterName);
|
||||
parameter.addExtension("x-python-connexion-openapi-name", swaggerParameterName);
|
||||
parameter.setName(pythonParameterName);
|
||||
@ -439,7 +439,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
}
|
||||
break;
|
||||
case OPENIDCONNECT:
|
||||
LOGGER.warn("Security type {} is not supported by connextion yet", securityScheme.getType().toString());
|
||||
LOGGER.warn("Security type {} is not supported by connexion yet", securityScheme.getType().toString());
|
||||
case OAUTH2:
|
||||
addSecurityExtension(securityScheme, "x-tokenInfoFunc", baseFunctionName + "info_from_" + securityName);
|
||||
addSecurityExtension(securityScheme, "x-scopeValidateFunc", baseFunctionName + "validate_scope_" + securityName);
|
||||
@ -503,7 +503,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
String openapiPathname = (String) pathExtensions.remove("x-python-connexion-openapi-name");
|
||||
if (openapiPathname != null && !openapiPathname.equals(pythonPathname)) {
|
||||
LOGGER.info(
|
||||
"Path '{}' is not consistant with the original OpenAPI definition. It will be replaced back by '{}'",
|
||||
"Path '{}' is not consistent with the original OpenAPI definition. It will be replaced back by '{}'",
|
||||
pythonPathname, openapiPathname);
|
||||
paths.remove(pythonPathname);
|
||||
paths.put(openapiPathname, path);
|
||||
@ -652,7 +652,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
operation.vendorExtensions.put("x-prefered-consume", consume);
|
||||
} else if (operation.consumes.size() > 1) {
|
||||
Map<String, String> consume = operation.consumes.get(0);
|
||||
skipTests.put("reason", "Connexion does not support multiple consummes. See https://github.com/zalando/connexion/pull/760");
|
||||
skipTests.put("reason", "Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760");
|
||||
operation.vendorExtensions.put("x-prefered-consume", consume);
|
||||
if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) {
|
||||
operation.isMultipart = Boolean.TRUE;
|
||||
|
@ -175,7 +175,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
|
||||
@Override
|
||||
public String toVarName(final String name) {
|
||||
String varName = sanitizeName(name);
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
varName = varName.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
||||
varName = "_u";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (!varName.matches("^[A-Z_0-9]*$")) {
|
||||
varName = getNameUsingModelPropertyNaming(varName);
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
||||
sanName = camelize(sanName);
|
||||
|
||||
// model name cannot use reserved keyword, e.g. return
|
||||
// this is unlikely to happen, because we have just camelized the name, while reserved words are usually all lowcase
|
||||
// this is unlikely to happen, because we have just camelized the name, while reserved words are usually all lowercase
|
||||
if (isReservedWord(sanName)) {
|
||||
String modelName = safePrefix + sanName;
|
||||
LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", sanName, modelName);
|
||||
|
@ -162,7 +162,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC));
|
||||
|
||||
supportedLibraries.put("volley", "HTTP client: Volley 1.0.19 (default)");
|
||||
supportedLibraries.put("httpclient", "HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be depecreated in the next major release.");
|
||||
supportedLibraries.put("httpclient", "HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be deprecated in the next major release.");
|
||||
CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
|
||||
library.setEnum(supportedLibraries);
|
||||
cliOptions.add(library);
|
||||
@ -260,7 +260,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
if ("abstract".equals(classModifier.getOptValue())) {
|
||||
operationModifier.setOptValue(classModifier.getOptValue());
|
||||
additionalProperties.put(OPERATION_MODIFIER, operationModifier.getOptValue());
|
||||
LOGGER.warn("classModifier is {} so forcing operatonModifier to {}", classModifier.getOptValue(), operationModifier.getOptValue());
|
||||
LOGGER.warn("classModifier is {} so forcing operationModifier to {}", classModifier.getOptValue(), operationModifier.getOptValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
/**
|
||||
* Allow the user to force the script to always include certain cURL
|
||||
* comamnds
|
||||
* commands
|
||||
*/
|
||||
cliOptions.add(CliOption.newString(CURL_OPTIONS, "Default cURL options"));
|
||||
cliOptions.add(CliOption.newBoolean(PROCESS_MARKDOWN,
|
||||
@ -529,7 +529,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
* remove standalone '\'
|
||||
*
|
||||
* replace " with \"
|
||||
* outter unescape to retain the original multi-byte characters
|
||||
* outer unescape to retain the original multi-byte characters
|
||||
*/
|
||||
result = escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
|
@ -553,7 +553,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
public String toVarName(String name) {
|
||||
// sanitize name
|
||||
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
name = name.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
@ -868,7 +868,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
return; // skip if C_POST_PROCESS_FILE env variable is not defined
|
||||
}
|
||||
|
||||
// only procees the following type (or we can simply rely on the file extension to check if it's a .c or .h file)
|
||||
// only process the following type (or we can simply rely on the file extension to check if it's a .c or .h file)
|
||||
Set<String> supportedFileType = new HashSet<String>(
|
||||
Arrays.asList(
|
||||
"supporting-mustache",
|
||||
|
@ -75,7 +75,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
// By default, generated code is considered public
|
||||
protected boolean nonPublicApi = Boolean.FALSE;
|
||||
|
||||
// use KellermanSoftware.CompareNetObjects for deep recursive object comparision
|
||||
// use KellermanSoftware.CompareNetObjects for deep recursive object comparison
|
||||
protected boolean useCompareNetObjects = Boolean.FALSE;
|
||||
|
||||
// To make API response's headers dictionary case insensitive
|
||||
@ -750,15 +750,15 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
@ -815,7 +815,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
// sanitize name
|
||||
name = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -890,7 +890,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
// sanitize name
|
||||
name = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -926,15 +926,15 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
|
@ -273,7 +273,7 @@ public class CppQtAbstractCodegen extends AbstractCppCodegen implements CodegenC
|
||||
String varName = name;
|
||||
varName = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (varName.matches("^[A-Z_]*$")) {
|
||||
varName = varName.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen {
|
||||
|
||||
// Write defaults namespace in properties so that it can be accessible in templates.
|
||||
// At this point command line has not been parsed so if value is given
|
||||
// in command line it will superseed this content
|
||||
// in command line it will supersede this content
|
||||
additionalProperties.put("cppNamespace", cppNamespace);
|
||||
additionalProperties.put("unrealModuleName", unrealModuleName);
|
||||
|
||||
@ -494,7 +494,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen {
|
||||
// sanitize name
|
||||
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
name = name.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
@ -820,7 +820,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
String varName;
|
||||
// sanitize name
|
||||
varName = sanitizeName(name);
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
varName = varName.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
* Returns the number of required parameters plus 1.
|
||||
*
|
||||
* @param os List of Codegen Parameters
|
||||
* @return the string representation of the number of required paramters plus 1
|
||||
* @return the string representation of the number of required parameters plus 1
|
||||
*/
|
||||
String length(Object os) {
|
||||
int l = 1;
|
||||
@ -371,7 +371,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
* Returns the number of required parameters or body parameters.
|
||||
*
|
||||
* @param os List of Codegen Parameters
|
||||
* @return the number of required paramters or body parameters
|
||||
* @return the number of required parameters or body parameters
|
||||
*/
|
||||
int lengthRequired(List<CodegenParameter> allParams) {
|
||||
int l = 0;
|
||||
|
@ -290,7 +290,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||
|
||||
// if it's all uppper case, convert to lower case
|
||||
// if it's all upper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
name = name.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen im
|
||||
ArraySchema ap = (ArraySchema) p;
|
||||
Schema inner = ap.getItems();
|
||||
|
||||
// IMPORTANT NOTE we add the braces within template because there we have the possibility to differenciate
|
||||
// IMPORTANT NOTE we add the braces within template because there we have the possibility to differentiate
|
||||
// between some specific types for GraphQL:
|
||||
// return "[" + getTypeDeclaration(inner) + "]";
|
||||
return getTypeDeclaration(inner);
|
||||
@ -137,7 +137,7 @@ public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen im
|
||||
return getTypeDeclaration(inner);
|
||||
}
|
||||
|
||||
// IMPORANT NOTE Not using the supertype invocation, because we want to UpperCamelize the type:
|
||||
// IMPORTANT NOTE Not using the supertype invocation, because we want to UpperCamelize the type:
|
||||
String schemaType = getSchemaType(p);
|
||||
String nullable = ModelUtils.isNullable(p) ? "" : "!";
|
||||
|
||||
|
@ -953,10 +953,10 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
}
|
||||
}
|
||||
|
||||
private void SetNoContent(CodegenOperation op, String inlineExtentionName) {
|
||||
private void SetNoContent(CodegenOperation op, String inlineExtensionName) {
|
||||
Map<String, String> m = new HashMap<>();
|
||||
m.put(X_MEDIA_DATA_TYPE, MIME_NO_CONTENT);
|
||||
op.vendorExtensions.put(inlineExtentionName, m);
|
||||
op.vendorExtensions.put(inlineExtensionName, m);
|
||||
}
|
||||
|
||||
private String toDedupedModelName(String paramNameType, String dataType, Boolean appendDataType) {
|
||||
@ -1418,7 +1418,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
// remove \t, \n, \r
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// outer unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
return escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
|
@ -64,7 +64,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
|
||||
modelPackage = "org.openapitools.model";
|
||||
outputFolder = "generated-code/JavaJaxRS-CXF";
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
@ -75,7 +75,7 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
|
||||
outputFolder = "generated-code/JavaJaxRS-CXF";
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
updateOption(USE_TAGS, String.valueOf(true));
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on " + RESTTEMPLATE + " library"));
|
||||
cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations));
|
||||
|
||||
supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.");
|
||||
supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.");
|
||||
supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x");
|
||||
supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.");
|
||||
supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
|
||||
|
@ -59,7 +59,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen {
|
||||
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
@ -40,7 +40,7 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp
|
||||
sourceFolder = "src/gen/java";
|
||||
useBeanValidation = true;
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
useJackson = convertPropertyToBoolean(JACKSON);
|
||||
|
||||
if (interfaceOnly) {
|
||||
// Change default artifactId if genereating interfaces only, before command line options are applied in base class.
|
||||
// Change default artifactId if generating interfaces only, before command line options are applied in base class.
|
||||
artifactId = "openapi-jaxrs-client";
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
|
||||
modelPackage = "com.prokarma.pkmst.model";
|
||||
invokerPackage = "com.prokarma.pkmst.controller";
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.GROUP_ID, this.getGroupId());
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
@ -74,7 +74,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
|
||||
projectTestFolder = projectFolder + "/test";
|
||||
testFolder = projectTestFolder;
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
@ -44,7 +44,7 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
useBeanValidation = true;
|
||||
outputFolder = "generated-code/JavaJaxRS-Resteasy-eap";
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
||||
apiTemplateFiles.put("apiServiceImpl.mustache", ".java");
|
||||
|
@ -39,7 +39,7 @@ public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen im
|
||||
artifactId = "openapi-jaxrs-resteasy-server";
|
||||
outputFolder = "generated-code/JavaJaxRS-Resteasy";
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
|
||||
apiTemplateFiles.put("apiService.mustache", ".java");
|
||||
|
@ -49,7 +49,7 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen {
|
||||
artifactId = "openapi-undertow-server";
|
||||
dateLibrary = "legacy"; //TODO: add joda support
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
updateOption(this.DATE_LIBRARY, this.getDateLibrary());
|
||||
|
@ -90,7 +90,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen {
|
||||
artifactVersion = apiVersion;
|
||||
this.setDateLibrary("java8");
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
updateOption(CodegenConstants.ARTIFACT_VERSION, this.getArtifactVersion());
|
||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||
|
@ -58,7 +58,7 @@ public class JavaVertXWebServerCodegen extends AbstractJavaCodegen {
|
||||
artifactVersion = apiVersion;
|
||||
this.setDateLibrary("java8");
|
||||
|
||||
// clioOptions default redifinition need to be updated
|
||||
// clioOptions default redefinition need to be updated
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
updateOption(CodegenConstants.ARTIFACT_VERSION, this.getArtifactVersion());
|
||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||
|
@ -486,7 +486,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
|
||||
name = "_u";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -1042,15 +1042,15 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
|
@ -537,7 +537,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
name = "_u";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
@ -1127,15 +1127,15 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
|
||||
// Iterate over all of the parent model properties
|
||||
boolean removedChildEnum = false;
|
||||
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||
for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) {
|
||||
// Look for enums
|
||||
if (parentModelCodegenPropery.isEnum) {
|
||||
if (parentModelCodegenProperty.isEnum) {
|
||||
// Now that we have found an enum in the parent class,
|
||||
// and search the child class for the same enum.
|
||||
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenProperty codegenProperty = iterator.next();
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) {
|
||||
// We found an enum in the child class that is
|
||||
// a duplicate of the one in the parent, so remove it.
|
||||
iterator.remove();
|
||||
|
@ -170,7 +170,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = name.replaceAll("-", "_");
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
return name;
|
||||
|
||||
|
@ -595,7 +595,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
name = "_u";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
|
||||
CliOption requestDateConverter = new CliOption(REQUEST_DATE_CONVERTER, "JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)");
|
||||
Map<String, String> requestDateConverterOptions = new HashMap<>();
|
||||
requestDateConverterOptions.put(RequestDateConverter.TO_JSON.value, "[DEFAULT] Date formater option using a json converter.");
|
||||
requestDateConverterOptions.put(RequestDateConverter.TO_JSON.value, "[DEFAULT] Date formatter option using a json converter.");
|
||||
requestDateConverterOptions.put(RequestDateConverter.TO_STRING.value, "Use the 'toString'-method of the date-time object to retrieve the related string representation.");
|
||||
requestDateConverter.setEnum(requestDateConverterOptions);
|
||||
requestDateConverter.setDefault(this.requestDateConverter);
|
||||
|
@ -640,8 +640,8 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
||||
/**
|
||||
* Processes each model's property type arguments definitions
|
||||
*
|
||||
* @param dataType the choosen sql type
|
||||
* @param dataFormat the choosen sql format
|
||||
* @param dataType the chosen sql type
|
||||
* @param dataFormat the chosen sql format
|
||||
* @param min the minimum value, if specified, in the target type
|
||||
* @param max the maximum value, if specified, in the target type
|
||||
* @param columnDefinition resulting column definition dictionary
|
||||
@ -1171,7 +1171,7 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets primary key naming convenion
|
||||
* Sets primary key naming convention
|
||||
*
|
||||
* @param name name
|
||||
*/
|
||||
@ -1180,7 +1180,7 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns primary key naming convenion
|
||||
* Returns primary key naming convention
|
||||
*
|
||||
* @return name
|
||||
*/
|
||||
@ -1189,7 +1189,7 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets primary key naming convenion
|
||||
* Sets primary key naming convention
|
||||
*
|
||||
* @param enable enable this option
|
||||
*/
|
||||
@ -1198,7 +1198,7 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns primary key naming convenion
|
||||
* Returns primary key naming convention
|
||||
*
|
||||
* @return is enabled
|
||||
*/
|
||||
|
@ -238,7 +238,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name.replaceAll("-", "_"));
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
return name;
|
||||
|
||||
|
@ -311,7 +311,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
name = "`" + name + "`";
|
||||
}
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z0-9_]*$")) {
|
||||
return name;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
typeMapping.put("UUID", "string");
|
||||
typeMapping.put("URI", "string");
|
||||
typeMapping.put("set", "`Set");
|
||||
typeMapping.put("passsword", "string");
|
||||
typeMapping.put("password", "string");
|
||||
typeMapping.put("DateTime", "string");
|
||||
|
||||
// supportedLibraries.put(CO_HTTP, "HTTP client: CoHttp.");
|
||||
|
@ -60,7 +60,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
protected boolean generateCoreData = false;
|
||||
|
||||
protected Set<String> advancedMapingTypes = new HashSet<String>();
|
||||
protected Set<String> advancedMappingTypes = new HashSet<String>();
|
||||
|
||||
public ObjcClientCodegen() {
|
||||
super();
|
||||
@ -117,15 +117,15 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
defaultIncludes.add("NSManagedObject");
|
||||
defaultIncludes.add("NSData");
|
||||
|
||||
advancedMapingTypes.add("NSDictionary");
|
||||
advancedMapingTypes.add("NSArray");
|
||||
advancedMapingTypes.add("NSMutableArray");
|
||||
advancedMapingTypes.add("NSMutableDictionary");
|
||||
advancedMapingTypes.add("NSObject");
|
||||
advancedMapingTypes.add("NSNumber");
|
||||
advancedMapingTypes.add("NSURL");
|
||||
advancedMapingTypes.add("NSString");
|
||||
advancedMapingTypes.add("NSDate");
|
||||
advancedMappingTypes.add("NSDictionary");
|
||||
advancedMappingTypes.add("NSArray");
|
||||
advancedMappingTypes.add("NSMutableArray");
|
||||
advancedMappingTypes.add("NSMutableDictionary");
|
||||
advancedMappingTypes.add("NSObject");
|
||||
advancedMappingTypes.add("NSNumber");
|
||||
advancedMappingTypes.add("NSURL");
|
||||
advancedMappingTypes.add("NSString");
|
||||
advancedMappingTypes.add("NSDate");
|
||||
|
||||
languageSpecificPrimitives.clear();
|
||||
languageSpecificPrimitives.add("NSNumber");
|
||||
@ -380,7 +380,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// In this condition, type of Schema p is array of model,
|
||||
// return container type combine inner type with pointer, e.g. `NSArray<SWGTag>*'
|
||||
else {
|
||||
for (String sd : advancedMapingTypes) {
|
||||
for (String sd : advancedMappingTypes) {
|
||||
if (innerTypeDeclaration.startsWith(sd)) {
|
||||
return getSchemaType(p) + "<" + innerTypeDeclaration + "*>*";
|
||||
}
|
||||
@ -398,7 +398,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
if (languageSpecificPrimitives.contains(innerTypeDeclaration)) {
|
||||
return getSchemaType(p) + "<NSString*, " + innerTypeDeclaration + "*>*";
|
||||
} else {
|
||||
for (String s : advancedMapingTypes) {
|
||||
for (String s : advancedMappingTypes) {
|
||||
if (innerTypeDeclaration.startsWith(s)) {
|
||||
return getSchemaType(p) + "<NSString*, " + innerTypeDeclaration + "*>*";
|
||||
}
|
||||
@ -455,7 +455,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
* Convert input to proper model name according to ObjC style guide
|
||||
* without checking for reserved words
|
||||
*
|
||||
* @param type Model anme
|
||||
* @param type Model name
|
||||
* @return model Name in ObjC style guide
|
||||
*/
|
||||
public String toModelNameWithoutReservedWordCheck(String type) {
|
||||
|
@ -347,7 +347,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
|
||||
}
|
||||
|
||||
// add prefix/suffic to model name
|
||||
// add prefix/suffix to model name
|
||||
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||
name = modelNamePrefix + "_" + name;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
|
||||
}
|
||||
|
||||
if (op.hasProduces) {
|
||||
// need to escape */* values because they breakes current mustaches
|
||||
// need to escape */* values because they breaks current mustaches
|
||||
List<Map<String, String>> c = op.produces;
|
||||
for (Map<String, String> mediaType : c) {
|
||||
if ("*/*".equals(mediaType.get("mediaType"))) {
|
||||
@ -258,7 +258,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
// sort the endpoints in ascending to avoid the route priority issure.
|
||||
// sort the endpoints in ascending to avoid the route priority issue.
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/2643
|
||||
Collections.sort(operations, new Comparator<CodegenOperation>() {
|
||||
@Override
|
||||
|
@ -175,7 +175,7 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
|
||||
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
// sort the endpoints in ascending to avoid the route priority issure.
|
||||
// sort the endpoints in ascending to avoid the route priority issue.
|
||||
Collections.sort(operations, new Comparator<CodegenOperation>() {
|
||||
@Override
|
||||
public int compare(CodegenOperation lhs, CodegenOperation rhs) {
|
||||
|
@ -301,7 +301,7 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen {
|
||||
// remove \t, \n, \r
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// outer unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
input = super.escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
|
@ -233,7 +233,7 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||
// remove \t, \n, \r
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// outer unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
input = super.escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
|
@ -304,7 +304,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
|
||||
additionalProperties.put("modelTestsPackage", modelTestsPackage);
|
||||
additionalProperties.put("controllerTestsPackage", controllerTestsPackage);
|
||||
|
||||
// make Symonfy-specific properties available
|
||||
// make Symfony-specific properties available
|
||||
additionalProperties.put("bundleName", bundleName);
|
||||
additionalProperties.put("bundleClassName", bundleClassName);
|
||||
additionalProperties.put("bundleExtensionName", bundleExtensionName);
|
||||
|
@ -206,13 +206,13 @@ public class PlantumlDocumentationCodegen extends DefaultCodegen implements Code
|
||||
|
||||
@Override
|
||||
public String escapeQuotationMark(String input) {
|
||||
// to surpress the warning message
|
||||
// to suppress the warning message
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeUnsafeCharacters(String input) {
|
||||
// to surpress the warning message
|
||||
// to suppress the warning message
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "powershell-expiermental";
|
||||
outputFolder = "generated-code" + File.separator + "powershell-experimental";
|
||||
modelTemplateFiles.put("model.mustache", ".ps1");
|
||||
apiTemplateFiles.put("api.mustache", ".ps1");
|
||||
modelTestTemplateFiles.put("model_test.mustache", ".ps1");
|
||||
@ -825,7 +825,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
// remove \t, \n, \r
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// outer unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
return escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
@ -1061,7 +1061,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
}
|
||||
}
|
||||
|
||||
// check if return type is oneOf/anyeOf model
|
||||
// check if return type is oneOf/anyOf model
|
||||
for (CodegenOperation op : operationList) {
|
||||
if (op.returnType != null) {
|
||||
// look up the model to see if it's anyOf/oneOf
|
||||
|
@ -99,7 +99,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
languageSpecificPrimitives.add("none_type");
|
||||
|
||||
// this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG
|
||||
// this generator uses the following order for endpoint paramters and model properties
|
||||
// this generator uses the following order for endpoint parameters and model properties
|
||||
// required params/props with no enum of length one
|
||||
// required params/props with enum of length one (which is used to set a default value as a python named arg value)
|
||||
// optional params/props with **kwargs in python
|
||||
@ -384,7 +384,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
* because they are not used we do not write them
|
||||
* - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer
|
||||
*
|
||||
* @param objs a map going from the model name to a object hoding the model info
|
||||
* @param objs a map going from the model name to an object holding the model info
|
||||
* @return the updated objs
|
||||
*/
|
||||
@Override
|
||||
@ -494,7 +494,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
* We have a custom version of this method to produce links to models when they are
|
||||
* primitive type (not map, not array, not object) and include validations or are enums
|
||||
*
|
||||
* @param body requesst body
|
||||
* @param body request body
|
||||
* @param imports import collection
|
||||
* @param bodyParameterName body parameter name
|
||||
* @return the resultant CodegenParameter
|
||||
@ -919,7 +919,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
public String getTypeDeclaration(Schema p) {
|
||||
// this is used to set dataType, which defines a python tuple of classes
|
||||
// in Python we will wrap this in () to make it a tuple but here we
|
||||
// will omit the parens so the generated documentaion will not include
|
||||
// will omit the parens so the generated documentation will not include
|
||||
// them
|
||||
return getTypeString(p, "", "", null);
|
||||
}
|
||||
@ -1042,12 +1042,12 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
* @param schema the schema that we need an example for
|
||||
* @param objExample the example that applies to this schema, for now only string example are used
|
||||
* @param indentationLevel integer indentation level that we are currently at
|
||||
* we assume the indentaion amount is 4 spaces times this integer
|
||||
* we assume the indentation amount is 4 spaces times this integer
|
||||
* @param prefix the string prefix that we will use when assigning an example for this line
|
||||
* this is used when setting key: value, pairs "key: " is the prefix
|
||||
* and this is used when setting properties like some_property='some_property_example'
|
||||
* @param exampleLine this is the current line that we are generatign an example for, starts at 0
|
||||
* we don't indentin the 0th line because using the example value looks like:
|
||||
* @param exampleLine this is the current line that we are generating an example for, starts at 0
|
||||
* we don't indent the 0th line because using the example value looks like:
|
||||
* prop = ModelName( line 0
|
||||
* some_property='some_property_example' line 1
|
||||
* ) line 2
|
||||
@ -1299,8 +1299,8 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
CodegenProperty cp = new CodegenProperty();
|
||||
cp.setName(disc.getPropertyName());
|
||||
cp.setExample(discPropNameValue);
|
||||
// Adds schema to seenSchemas before running example model function. romoves schema after running
|
||||
// the function. It also doesnt keep track of any schemas within the ObjectModel.
|
||||
// Adds schema to seenSchemas before running example model function. removes schema after running
|
||||
// the function. It also doesn't keep track of any schemas within the ObjectModel.
|
||||
Set<Schema> newSeenSchemas = new HashSet<>(seenSchemas);
|
||||
newSeenSchemas.add(schema);
|
||||
String exampleForObjectModel = exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, newSeenSchemas);
|
||||
|
@ -262,7 +262,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name.replaceAll("-", "_"));
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
return name;
|
||||
|
||||
|
@ -291,7 +291,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
|
||||
*
|
||||
* @param gemName Ruby gem name
|
||||
*
|
||||
* @return Ruby module naame
|
||||
* @return Ruby module name
|
||||
*/
|
||||
@SuppressWarnings("static-method")
|
||||
public String generateModuleName(String gemName) {
|
||||
@ -301,7 +301,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
|
||||
/**
|
||||
* Generate Ruby gem name from the module name, e.g. use "openapi_client" for "OpenAPIClient".
|
||||
*
|
||||
* @param moduleName Ruby module naame
|
||||
* @param moduleName Ruby module name
|
||||
*
|
||||
* @return Ruby gem name
|
||||
*/
|
||||
|
@ -136,7 +136,7 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen {
|
||||
} else if ("mysql".equals(databaseAdapter)) {
|
||||
additionalProperties.put("isDBMySQL", Boolean.TRUE);
|
||||
} else {
|
||||
LOGGER.warn("Unknown database {}. Defaul to 'sqlite'.", databaseAdapter);
|
||||
LOGGER.warn("Unknown database {}. Default to 'sqlite'.", databaseAdapter);
|
||||
additionalProperties.put("isDBSQLite", Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
@ -361,7 +361,7 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name.replaceAll("-", "_"));
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
// if it's all upper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
return name;
|
||||
|
||||
|
@ -453,7 +453,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo
|
||||
}
|
||||
p.vendorExtensions.put("x-codegen-normalized-input-type", toInputParameter(p));
|
||||
} else {
|
||||
//Path paremeters are handled in generateScalaPath()
|
||||
//Path parameters are handled in generateScalaPath()
|
||||
p.vendorExtensions.put("x-codegen-normalized-input-type", p.dataType);
|
||||
}
|
||||
if (p.vendorExtensions.get("x-codegen-normalized-path-type") != null) {
|
||||
|
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