diff --git a/bin/configs/jaxrs-cxf-cdi.yaml b/bin/configs/jaxrs-cxf-cdi.yaml index 59b8fc8c336..63299c1d4e9 100644 --- a/bin/configs/jaxrs-cxf-cdi.yaml +++ b/bin/configs/jaxrs-cxf-cdi.yaml @@ -4,3 +4,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi additionalProperties: hideGenerationTimestamp: "true" + implicitHeadersRegex: api_key diff --git a/bin/configs/jaxrs-cxf.yaml b/bin/configs/jaxrs-cxf.yaml index 81988d2576d..76c2b2108fc 100644 --- a/bin/configs/jaxrs-cxf.yaml +++ b/bin/configs/jaxrs-cxf.yaml @@ -5,3 +5,4 @@ templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: hideGenerationTimestamp: "true" serverPort: "8082" + implicitHeadersRegex: (api_key|enum_header_string) diff --git a/bin/configs/jaxrs-resteasy-default.yaml b/bin/configs/jaxrs-resteasy-default.yaml index 3fd9e38fb2b..e05f414253f 100644 --- a/bin/configs/jaxrs-resteasy-default.yaml +++ b/bin/configs/jaxrs-resteasy-default.yaml @@ -4,3 +4,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy additionalProperties: hideGenerationTimestamp: "true" + implicitHeadersRegex: api_key diff --git a/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml b/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml index 3315b6e1a02..5191921e8e6 100644 --- a/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml +++ b/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml @@ -6,3 +6,4 @@ additionalProperties: artifactId: jaxrs-resteasy-eap-java8-server hideGenerationTimestamp: "true" dateLibrary: java8 + implicitHeadersRegex: api_key diff --git a/bin/configs/jaxrs-spec-interface.yaml b/bin/configs/jaxrs-spec-interface.yaml index ee328043708..57a5034b273 100644 --- a/bin/configs/jaxrs-spec-interface.yaml +++ b/bin/configs/jaxrs-spec-interface.yaml @@ -7,3 +7,4 @@ additionalProperties: interfaceOnly: "true" serializableModel: "true" hideGenerationTimestamp: "true" + implicitHeadersRegex: (api_key|enum_header_string) diff --git a/bin/configs/jaxrs-spec.yaml b/bin/configs/jaxrs-spec.yaml index 9e98a9ae5c8..9e0e6ce8051 100644 --- a/bin/configs/jaxrs-spec.yaml +++ b/bin/configs/jaxrs-spec.yaml @@ -6,3 +6,4 @@ additionalProperties: artifactId: jaxrs-spec-petstore-server serializableModel: "true" hideGenerationTimestamp: "true" + implicitHeadersRegex: (api_key|enum_header_string) diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml index 5457e89b831..d870353a0ff 100644 --- a/bin/configs/spring-boot-implicitHeaders.yaml +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -6,4 +6,4 @@ additionalProperties: artifactId: springboot-implicitHeaders documentationProvider: springfox hideGenerationTimestamp: "true" - implicitHeaders: true + implicitHeadersRegex: .* diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index e7493ca6d8b..8227b6b5ca9 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -40,6 +40,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 5438c703d5a..66a914004b2 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 775a8d58abe..ce239d77145 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.controllers| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 6bf00520307..7f5f06678fc 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -43,6 +43,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 67d2870b8cb..2b5db618834 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -44,6 +44,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index bae5eaf9253..bc880a88ccb 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -43,6 +43,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |library|library template (sub-template)|
**jersey1**
Jersey core 1.x
**jersey2**
Jersey core 2.x
|jersey2| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index eb7454a2b24..22dce4e01d3 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -44,6 +44,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |com.prokarma| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 110f537d1df..449902ad3d6 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -46,6 +46,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index c20ab6b0802..fe7db5e1a11 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.handler| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index f8e1e6f775a..90b207cc90c 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 27a7ee0a002..8a8f04bb635 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java.md b/docs/generators/java.md index 44c8c3cb585..24823ce8742 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -48,6 +48,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.client| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |library|library template (sub-template) to use|
**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.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
**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'.
**retrofit2**
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)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B
**apache-httpclient**
HTTP client: Apache httpclient 4.x
|okhttp-gson| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 85c3caa929e..9e52f30f3cd 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -45,6 +45,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index e1f375f0c96..8734acf3757 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 1d1cd197970..1cfa6773577 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -49,6 +49,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index cc17d44b9d4..bb0a2d57c5d 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -48,6 +48,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 781d27b728a..e32bc95ffb5 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -43,6 +43,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |library|library template (sub-template)|
**jersey1**
Jersey core 1.x
**jersey2**
Jersey core 2.x
|jersey2| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 741458572ed..3354f141638 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -44,6 +44,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index f84b4ee62c4..4aac82dc7a7 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -44,6 +44,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index bb915c9ed65..0fb0e933feb 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -45,6 +45,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index b820f6c1852..2cfb8e1a414 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -51,6 +51,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index 75e08a6f7c4..ebafb6b5e42 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -42,6 +42,7 @@ public class CodegenOperation { public List pathParams = new ArrayList(); public List queryParams = new ArrayList(); public List headerParams = new ArrayList(); + public List implicitHeadersParams = new ArrayList(); public List formParams = new ArrayList(); public List cookieParams = new ArrayList(); public List requiredParams = new ArrayList(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index f6a7c01daa0..a01a9eca496 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -70,6 +70,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String OPENAPI_NULLABLE = "openApiNullable"; public static final String JACKSON = "jackson"; public static final String TEST_OUTPUT = "testOutput"; + public static final String IMPLICIT_HEADERS = "implicitHeaders"; + public static final String IMPLICIT_HEADERS_REGEX = "implicitHeadersRegex"; public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; @@ -117,6 +119,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected String outputTestFolder = ""; protected DocumentationProvider documentationProvider; protected AnnotationLibrary annotationLibrary; + protected boolean implicitHeaders = false; + protected String implicitHeadersRegex = null; public AbstractJavaCodegen() { super(); @@ -246,6 +250,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable)); + cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); + cliOptions.add(CliOption.newString(IMPLICIT_HEADERS_REGEX, "Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true")); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC)); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC)); @@ -525,6 +531,14 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.setParentVersion((String) additionalProperties.get(CodegenConstants.PARENT_VERSION)); } + if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { + this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString())); + } + + if (additionalProperties.containsKey(IMPLICIT_HEADERS_REGEX)) { + this.setImplicitHeadersRegex(additionalProperties.get(IMPLICIT_HEADERS_REGEX).toString()); + } + if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) { additionalProperties.put("parentOverridden", true); } @@ -1357,6 +1371,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } } op.vendorExtensions.put("x-java-import", operationImports); + + handleImplicitHeaders(op); } return objs; } @@ -1384,7 +1400,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } String accepts = getAccept(openAPI, operation); operation.addExtension("x-accepts", accepts); - } } } @@ -1823,6 +1838,14 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.annotationLibrary = annotationLibrary; } + public void setImplicitHeaders(boolean implicitHeaders) { + this.implicitHeaders = implicitHeaders; + } + + public void setImplicitHeadersRegex(String implicitHeadersRegex) { + this.implicitHeadersRegex = implicitHeadersRegex; + } + @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -2004,6 +2027,33 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } } + /** + * This method removes all implicit header parameters from the list of parameters + * + * @param operation - operation to be processed + */ + protected void handleImplicitHeaders(CodegenOperation operation) { + if (operation.allParams.isEmpty()) { + return; + } + final ArrayList copy = new ArrayList<>(operation.allParams); + operation.allParams.clear(); + + for (CodegenParameter p : copy) { + if (p.isHeaderParam && (implicitHeaders || shouldBeImplicitHeader(p))) { + operation.implicitHeadersParams.add(p); + operation.headerParams.removeIf(header -> header.baseName.equals(p.baseName)); + LOGGER.info("Update operation [{}]. Remove header [{}] because it's marked to be implicit", operation.operationId, p.baseName); + } else { + operation.allParams.add(p); + } + } + } + + private boolean shouldBeImplicitHeader(CodegenParameter parameter) { + return StringUtils.isNotBlank(implicitHeadersRegex) && parameter.baseName.matches(implicitHeadersRegex); + } + @Override public List getSupportedVendorExtensions() { List extensions = super.getSupportedVendorExtensions(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java index 0cb56e084e1..85d6de7e78a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -167,8 +167,17 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen } @Override + @SuppressWarnings("unchecked") public Map postProcessOperationsWithModels(Map objs, List allModels) { - return jaxrsPostProcessOperations(objs); + Map updatedObjs = jaxrsPostProcessOperations(objs); + Map operations = (Map) updatedObjs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation co : ops) { + handleImplicitHeaders(co); + } + } + return updatedObjs; } static Map jaxrsPostProcessOperations(Map objs) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java index 90c3d3b4ff4..eab42e0db77 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java @@ -45,7 +45,6 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { protected String basePackage = "com.prokarma.pkmst"; protected String serviceName = "Pkmst"; protected String configPackage = "com.prokarma.pkmst.config"; - protected boolean implicitHeaders = false; protected String title; protected String eurekaUri; protected String zipkinUri; @@ -347,34 +346,13 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { } }); - if (implicitHeaders) { - removeHeadersFromAllParams(operation.allParams); - } + handleImplicitHeaders(operation); } } return objs; } - /** - * This method removes header parameters from the list of parameters - * - * @param allParams list of all parameters - */ - private void removeHeadersFromAllParams(List allParams) { - if (allParams.isEmpty()) { - return; - } - final ArrayList copy = new ArrayList<>(allParams); - allParams.clear(); - - for (CodegenParameter p : copy) { - if (!p.isHeaderParam) { - allParams.add(p); - } - } - } - /** * @param returnType The return type that needs to be converted * @param dataTypeAssigner An object that will assign the data to the respective fields diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java index 8698bd98dea..527e38d699e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java @@ -117,11 +117,6 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen } - @Override - public Map postProcessOperationsWithModels(Map objs, List allModels) { - return super.postProcessOperationsWithModels(objs, allModels); - } - @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java index 5a86c38ab25..2608d603b4c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java @@ -128,11 +128,6 @@ public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen im } } - @Override - public Map postProcessOperationsWithModels(Map objs, List allModels) { - return super.postProcessOperationsWithModels(objs, allModels); - } - @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 10b2748b201..59733304da4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -86,7 +86,6 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String USE_TAGS = "useTags"; public static final String SPRING_BOOT = "spring-boot"; public static final String SPRING_CLOUD_LIBRARY = "spring-cloud"; - public static final String IMPLICIT_HEADERS = "implicitHeaders"; public static final String API_FIRST = "apiFirst"; public static final String SPRING_CONTROLLER = "useSpringController"; public static final String HATEOAS = "hateoas"; @@ -110,7 +109,6 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean useTags = false; protected boolean useBeanValidation = true; protected boolean performBeanValidation = false; - protected boolean implicitHeaders = false; protected boolean apiFirst = false; protected boolean useOptional = false; protected boolean virtualService = false; @@ -180,9 +178,6 @@ public class SpringCodegen extends AbstractJavaCodegen .add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation)); cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Use Bean Validation Impl. to perform BeanValidation", performBeanValidation)); - cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, - "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", - implicitHeaders)); cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); cliOptions @@ -369,10 +364,6 @@ public class SpringCodegen extends AbstractJavaCodegen this.setUseOptional(convertPropertyToBoolean(USE_OPTIONAL)); } - if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { - this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString())); - } - if (additionalProperties.containsKey(API_FIRST)) { this.setApiFirst(Boolean.parseBoolean(additionalProperties.get(API_FIRST).toString())); } @@ -665,9 +656,7 @@ public class SpringCodegen extends AbstractJavaCodegen } }); - if (implicitHeaders) { - removeHeadersFromAllParams(operation.allParams); - } + handleImplicitHeaders(operation); } } @@ -710,25 +699,6 @@ public class SpringCodegen extends AbstractJavaCodegen } } - /** - * This method removes header parameters from the list of parameters - * - * @param allParams list of all parameters - */ - private void removeHeadersFromAllParams(List allParams) { - if (allParams.isEmpty()) { - return; - } - final ArrayList copy = new ArrayList<>(allParams); - allParams.clear(); - - for (final CodegenParameter p : copy) { - if (!p.isHeaderParam) { - allParams.add(p); - } - } - } - @Override public Map postProcessSupportingFileData(Map objs) { generateYAMLSpecFile(objs); @@ -839,10 +809,6 @@ public class SpringCodegen extends AbstractJavaCodegen this.useTags = useTags; } - public void setImplicitHeaders(boolean implicitHeaders) { - this.implicitHeaders = implicitHeaders; - } - public void setApiFirst(boolean apiFirst) { this.apiFirst = apiFirst; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index 95e6c810bc6..09893b8df21 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -76,6 +76,13 @@ public class {{classname}} { @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}} {{/responses}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) throws NotFoundException { return delegate.{{nickname}}({{#allParams}}{{#isFormParam}}{{#isFile}}{{paramName}}Bodypart{{/isFile}}{{/isFormParam}}{{^isFile}}{{paramName}}{{/isFile}}{{^isFormParam}}{{#isFile}}{{paramName}}{{/isFile}}{{/isFormParam}}, {{/allParams}}securityContext); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache index b41c719f994..fec0a5d7b25 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache @@ -51,6 +51,13 @@ public class {{classname}} { {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache index 8c517fd6dd5..3c663fdf3bf 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache @@ -61,6 +61,13 @@ public interface {{classname}} { @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) public {{>returnTypes}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache index 09f19bbe5dd..bb271cdb3c1 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -61,6 +61,13 @@ public interface {{classname}} { @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache index d7299149e05..6751fc0b068 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache @@ -49,6 +49,13 @@ public class {{classname}} { }{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @io.swagger.annotations.ApiResponses(value = { {{#responses}} @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}( diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache index 5cdf6ea0be0..c314c4d823c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache @@ -49,6 +49,13 @@ public class {{classname}} { }{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @io.swagger.annotations.ApiResponses(value = { {{#responses}} @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}} }) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache index db3a8fb3430..b4002a51d4e 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache @@ -43,6 +43,13 @@ public interface {{classname}} { }{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @io.swagger.annotations.ApiResponses(value = { {{#responses}} @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}} }) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache index 77e7bd3e3da..748fe4dcfa6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache @@ -8,6 +8,13 @@ {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache index edecd390f9c..4cf0201c7a3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache @@ -8,6 +8,13 @@ {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + {{#implicitHeadersParams.0}} + @io.swagger.annotations.ApiImplicitParams({ + {{#implicitHeadersParams}} + @io.swagger.annotations.ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + {{/implicitHeadersParams}} + }) + {{/implicitHeadersParams.0}} @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index f9096e758a8..d0becab0428 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -184,21 +184,21 @@ public interface {{classname}} { {{/responses}} }) {{/swagger1AnnotationLibrary}} - {{#implicitHeaders}} + {{#implicitHeadersParams.0}} {{#swagger2AnnotationLibrary}} @Parameters({ - {{#headerParams}} + {{#implicitHeadersParams}} {{>paramDoc}}{{^-last}},{{/-last}} - {{/headerParams}} + {{/implicitHeadersParams}} {{/swagger2AnnotationLibrary}} {{#swagger1AnnotationLibrary}} @ApiImplicitParams({ - {{#headerParams}} + {{#implicitHeadersParams}} {{>implicitHeader}}{{^-last}},{{/-last}} - {{/headerParams}} + {{/implicitHeadersParams}} {{/swagger1AnnotationLibrary}} }) - {{/implicitHeaders}} + {{/implicitHeadersParams.0}} @RequestMapping( method = RequestMethod.{{httpMethod}}, value = "{{{path}}}"{{#singleContentTypes}}{{#hasProduces}}, diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/implicitHeader.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/implicitHeader.mustache index 77e151eedaa..0453940ce57 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/implicitHeader.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/implicitHeader.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache index 853bd61f06d..c899abe7b98 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache @@ -50,11 +50,11 @@ public interface {{classname}} { {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) - {{#implicitHeaders}} + {{#implicitHeadersParams.0}} @ApiImplicitParams({ - {{#headerParams}}{{>implicitHeader}}{{/headerParams}} + {{#implicitHeadersParams}}{{>implicitHeader}}{{/implicitHeadersParams}} }) - {{/implicitHeaders}} + {{/implicitHeadersParams.0}} @RequestMapping( method = RequestMethod.{{httpMethod}}, value = "{{{path}}}"{{#singleContentTypes}}, diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/implicitHeader.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/implicitHeader.mustache index cda039e4ccb..31457411491 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/implicitHeader.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/implicitHeader.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required=true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required=true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index ce1e6528912..5bd165280c4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -131,7 +131,7 @@ public class JavaClientCodegenTest { CodegenParameter pathParam1 = createPathParam("pathParam1"); CodegenParameter pathParam2 = createPathParam("pathParam2"); - codegenOperation.allParams = Arrays.asList(queryParamRequired, pathParam1, pathParam2, queryParamOptional); + codegenOperation.allParams.addAll(Arrays.asList(queryParamRequired, pathParam1, pathParam2, queryParamOptional)); Map operations = ImmutableMap.of("operation", Arrays.asList(codegenOperation)); Map objs = ImmutableMap.of("operations", operations, "imports", new ArrayList>()); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 252c6c11f3c..653d00e34e9 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -55,8 +55,6 @@ public interface AnotherFakeApi { }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PATCH, value = "/another-fake/dummy", diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 37d1b62f30f..69a672b93ff 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -63,8 +63,6 @@ public interface FakeApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", @@ -94,8 +92,6 @@ public interface FakeApi { }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", @@ -125,8 +121,6 @@ public interface FakeApi { }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", @@ -165,8 +159,6 @@ public interface FakeApi { }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", @@ -196,8 +188,6 @@ public interface FakeApi { }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", @@ -225,8 +215,6 @@ public interface FakeApi { @ApiResponse(responseCode = "200", description = "Success") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", @@ -254,8 +242,6 @@ public interface FakeApi { @ApiResponse(responseCode = "200", description = "Success") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", @@ -287,8 +273,6 @@ public interface FakeApi { }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PATCH, value = "/fake", @@ -345,8 +329,6 @@ public interface FakeApi { @SecurityRequirement(name = "http_basic_test") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake", @@ -468,8 +450,6 @@ public interface FakeApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", @@ -498,8 +478,6 @@ public interface FakeApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", @@ -532,8 +510,6 @@ public interface FakeApi { @ApiResponse(responseCode = "200", description = "Success") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" @@ -571,8 +547,6 @@ public interface FakeApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c731b97ec12..993f4a4b4ef 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -58,8 +58,6 @@ public interface FakeClassnameTestApi { @SecurityRequirement(name = "api_key_query") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PATCH, value = "/fake_classname_test", diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index c0c4cc58b14..36748c4705f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -59,8 +59,6 @@ public interface PetApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/pet", @@ -131,8 +129,6 @@ public interface PetApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", @@ -184,8 +180,6 @@ public interface PetApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", @@ -238,8 +232,6 @@ public interface PetApi { @SecurityRequirement(name = "api_key") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", @@ -290,8 +282,6 @@ public interface PetApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", @@ -324,8 +314,6 @@ public interface PetApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", @@ -362,8 +350,6 @@ public interface PetApi { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 3c42250c555..963a60ac29a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -56,8 +56,6 @@ public interface StoreApi { @ApiResponse(responseCode = "404", description = "Order not found") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" @@ -89,8 +87,6 @@ public interface StoreApi { @SecurityRequirement(name = "api_key") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/store/inventory", @@ -126,8 +122,6 @@ public interface StoreApi { @ApiResponse(responseCode = "404", description = "Order not found") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", @@ -174,8 +168,6 @@ public interface StoreApi { @ApiResponse(responseCode = "400", description = "Invalid Order") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index b375b927cc8..f4555ba9a1d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -55,8 +55,6 @@ public interface UserApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/user" @@ -83,8 +81,6 @@ public interface UserApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" @@ -111,8 +107,6 @@ public interface UserApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" @@ -142,8 +136,6 @@ public interface UserApi { @ApiResponse(responseCode = "404", description = "User not found") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" @@ -177,8 +169,6 @@ public interface UserApi { @ApiResponse(responseCode = "404", description = "User not found") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", @@ -226,8 +216,6 @@ public interface UserApi { @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", @@ -255,8 +243,6 @@ public interface UserApi { @ApiResponse(responseCode = "200", description = "successful operation") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.GET, value = "/user/logout" @@ -287,8 +273,6 @@ public interface UserApi { @ApiResponse(responseCode = "404", description = "User not found") } ) - @Parameters({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index de11d272cc3..00000000000 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java index 76d6eb42505..57c63b56395 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java @@ -61,10 +61,13 @@ public class PetApi { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey) { - return delegate.deletePet(petId, apiKey, securityContext); + public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId) { + return delegate.deletePet(petId, securityContext); } @GET diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java index 7272b6076d0..cd8754bc876 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java @@ -20,7 +20,7 @@ import javax.ws.rs.core.SecurityContext; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") public interface PetApiService { public Response addPet(Pet body, SecurityContext securityContext); - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); + public Response deletePet(Long petId, SecurityContext securityContext); public Response findPetsByStatus(List status, SecurityContext securityContext); @Deprecated public Response findPetsByTags(List tags, SecurityContext securityContext); public Response getPetById(Long petId, SecurityContext securityContext); diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index b67a47dc56f..ad4a6518971 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -26,7 +26,7 @@ public class PetApiServiceImpl implements PetApiService { return Response.ok().entity("magic!").build(); } @Override - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { + public Response deletePet(Long petId, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java index 74f95d7a95d..b21fadcb1b2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java @@ -140,10 +140,13 @@ public interface FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @ApiOperation(value = "To test enum parameters", tags={ "fake" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - public void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg")String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString); + public void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg")String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString); /** * Fake endpoint to test group parameters (optional) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java index 924046ee937..70ecf6c958c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java @@ -52,10 +52,13 @@ public interface PetApi { @DELETE @Path("/pet/{petId}") @ApiOperation(value = "Deletes a pet", tags={ "pet" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + public void deletePet(@PathParam("petId") Long petId); /** * Finds Pets by status diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 43c7e8d6115..ee9663c0455 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -31,9 +31,8 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { */ public Client call123testSpecialTags(Client body) { // TODO: Implement... - + return null; } - -} +} diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 05800385193..a675c6aab67 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -40,46 +40,46 @@ public class FakeApiServiceImpl implements FakeApi { */ public void createXmlItem(XmlItem xmlItem) { // TODO: Implement... - + } - + public Boolean fakeOuterBooleanSerialize(Boolean body) { // TODO: Implement... - + return null; } - + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) { // TODO: Implement... - + return null; } - + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) { // TODO: Implement... - + return null; } - + public String fakeOuterStringSerialize(String body) { // TODO: Implement... - + return null; } - + public void testBodyWithFileSchema(FileSchemaTestClass body) { // TODO: Implement... - + } - + public void testBodyWithQueryParams(String query, User body) { // TODO: Implement... - + } - + /** * To test \"client\" model * @@ -88,10 +88,10 @@ public class FakeApiServiceImpl implements FakeApi { */ public Client testClientModel(Client body) { // TODO: Implement... - + return null; } - + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -100,22 +100,22 @@ public class FakeApiServiceImpl implements FakeApi { */ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, Attachment binaryDetail, LocalDate date, Date dateTime, String password, String paramCallback) { // TODO: Implement... - + } - + /** * To test enum parameters * * To test enum parameters * */ - public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) { + public void testEnumParameters(List enumHeaderStringArray, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) { // TODO: Implement... - + } - + /** * Fake endpoint to test group parameters (optional) * @@ -124,35 +124,34 @@ public class FakeApiServiceImpl implements FakeApi { */ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { // TODO: Implement... - + } - + /** * test inline additionalProperties * */ public void testInlineAdditionalProperties(Map param) { // TODO: Implement... - + } - + /** * test json serialization of form data * */ public void testJsonFormData(String param, String param2) { // TODO: Implement... - + } - + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { // TODO: Implement... - + } - -} +} diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 3803ecd3927..630bc007834 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -31,9 +31,8 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A */ public Client testClassname(Client body) { // TODO: Implement... - + return null; } - -} +} diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index d6c02584e37..8876e678efc 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -32,20 +32,20 @@ public class PetApiServiceImpl implements PetApi { */ public void addPet(Pet body) { // TODO: Implement... - + } - + /** * Deletes a pet * */ - public void deletePet(Long petId, String apiKey) { + public void deletePet(Long petId) { // TODO: Implement... - + } - + /** * Finds Pets by status * @@ -54,10 +54,10 @@ public class PetApiServiceImpl implements PetApi { */ public List findPetsByStatus(List status) { // TODO: Implement... - + return null; } - + /** * Finds Pets by tags * @@ -66,10 +66,10 @@ public class PetApiServiceImpl implements PetApi { */ public Set findPetsByTags(Set tags) { // TODO: Implement... - + return null; } - + /** * Find pet by ID * @@ -78,49 +78,48 @@ public class PetApiServiceImpl implements PetApi { */ public Pet getPetById(Long petId) { // TODO: Implement... - + return null; } - + /** * Update an existing pet * */ public void updatePet(Pet body) { // TODO: Implement... - + } - + /** * Updates a pet in the store with form data * */ public void updatePetWithForm(Long petId, String name, String status) { // TODO: Implement... - + } - + /** * uploads an image * */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment _fileDetail) { // TODO: Implement... - + return null; } - + /** * uploads an image (required) * */ public ModelApiResponse uploadFileWithRequiredFile(Long petId, Attachment requiredFileDetail, String additionalMetadata) { // TODO: Implement... - + return null; } - -} +} diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 33b5142f537..668e92ac0ac 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -32,10 +32,10 @@ public class StoreApiServiceImpl implements StoreApi { */ public void deleteOrder(String orderId) { // TODO: Implement... - + } - + /** * Returns pet inventories by status * @@ -44,10 +44,10 @@ public class StoreApiServiceImpl implements StoreApi { */ public Map getInventory() { // TODO: Implement... - + return null; } - + /** * Find purchase order by ID * @@ -56,19 +56,18 @@ public class StoreApiServiceImpl implements StoreApi { */ public Order getOrderById(Long orderId) { // TODO: Implement... - + return null; } - + /** * Place an order for a pet * */ public Order placeOrder(Order body) { // TODO: Implement... - + return null; } - -} +} diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index f867dfc43bb..8acaea3278c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -1,6 +1,7 @@ package org.openapitools.api.impl; import org.openapitools.api.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; @@ -32,30 +33,30 @@ public class UserApiServiceImpl implements UserApi { */ public void createUser(User body) { // TODO: Implement... - + } - + /** * Creates list of users with given input array * */ public void createUsersWithArrayInput(List body) { // TODO: Implement... - + } - + /** * Creates list of users with given input array * */ public void createUsersWithListInput(List body) { // TODO: Implement... - + } - + /** * Delete user * @@ -64,40 +65,40 @@ public class UserApiServiceImpl implements UserApi { */ public void deleteUser(String username) { // TODO: Implement... - + } - + /** * Get user by user name * */ public User getUserByName(String username) { // TODO: Implement... - + return null; } - + /** * Logs user into the system * */ public String loginUser(String username, String password) { // TODO: Implement... - + return null; } - + /** * Logs out current logged in user session * */ public void logoutUser() { // TODO: Implement... - + } - + /** * Updated user * @@ -106,9 +107,8 @@ public class UserApiServiceImpl implements UserApi { */ public void updateUser(String username, User body) { // TODO: Implement... - + } - -} +} diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java index b1e50fee917..e4f41cc407b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -51,23 +39,23 @@ import java.util.Map; * *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * API tests for AnotherFakeApi + * API tests for AnotherFakeApi */ public class AnotherFakeApiTest { private AnotherFakeApi api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", AnotherFakeApi.class, providers); org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); + + ClientConfiguration config = WebClient.getConfig(client); } @@ -85,8 +73,8 @@ public class AnotherFakeApiTest { //Client response = api.call123testSpecialTags(body); //assertNotNull(response); // TODO: test validations - - + + } } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java index 6c3af9f58f7..272fbb72f43 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -60,23 +48,23 @@ import java.util.Map; * *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * API tests for FakeApi + * API tests for FakeApi */ public class FakeApiTest { private FakeApi api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", FakeApi.class, providers); org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); + + ClientConfiguration config = WebClient.getConfig(client); } @@ -94,8 +82,8 @@ public class FakeApiTest { //api.createXmlItem(xmlItem); // TODO: test validations - - + + } /** @@ -108,8 +96,8 @@ public class FakeApiTest { //Boolean response = api.fakeOuterBooleanSerialize(body); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -122,8 +110,8 @@ public class FakeApiTest { //OuterComposite response = api.fakeOuterCompositeSerialize(body); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -136,8 +124,8 @@ public class FakeApiTest { //BigDecimal response = api.fakeOuterNumberSerialize(body); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -150,8 +138,8 @@ public class FakeApiTest { //String response = api.fakeOuterStringSerialize(body); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -164,8 +152,8 @@ public class FakeApiTest { //api.testBodyWithFileSchema(body); // TODO: test validations - - + + } /** @@ -179,8 +167,8 @@ public class FakeApiTest { //api.testBodyWithQueryParams(query, body); // TODO: test validations - - + + } /** @@ -197,8 +185,8 @@ public class FakeApiTest { //Client response = api.testClientModel(body); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -228,8 +216,8 @@ public class FakeApiTest { //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); // TODO: test validations - - + + } /** @@ -243,18 +231,17 @@ public class FakeApiTest { @Test public void testEnumParametersTest() { List enumHeaderStringArray = null; - String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; List enumFormStringArray = null; String enumFormString = null; - //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + //api.testEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations - - + + } /** @@ -276,8 +263,8 @@ public class FakeApiTest { //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations - - + + } /** @@ -292,8 +279,8 @@ public class FakeApiTest { //api.testInlineAdditionalProperties(param); // TODO: test validations - - + + } /** @@ -309,8 +296,8 @@ public class FakeApiTest { //api.testJsonFormData(param, param2); // TODO: test validations - - + + } /** @@ -327,8 +314,8 @@ public class FakeApiTest { //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); // TODO: test validations - - + + } } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeClassnameTags123ApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeClassnameTags123ApiTest.java index 15194d65a81..a20299dcb2c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeClassnameTags123ApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeClassnameTags123ApiTest.java @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -51,23 +39,23 @@ import java.util.Map; * *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * API tests for FakeClassnameTags123Api + * API tests for FakeClassnameTags123Api */ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", FakeClassnameTags123Api.class, providers); org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); + + ClientConfiguration config = WebClient.getConfig(client); } @@ -85,8 +73,8 @@ public class FakeClassnameTags123ApiTest { //Client response = api.testClassname(body); //assertNotNull(response); // TODO: test validations - - + + } } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java index 583edd073b3..69889c13319 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -54,23 +42,23 @@ import java.util.Map; * *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * API tests for PetApi + * API tests for PetApi */ public class PetApiTest { private PetApi api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", PetApi.class, providers); org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); + + ClientConfiguration config = WebClient.getConfig(client); } @@ -86,8 +74,8 @@ public class PetApiTest { //api.addPet(body); // TODO: test validations - - + + } /** @@ -99,12 +87,11 @@ public class PetApiTest { @Test public void deletePetTest() { Long petId = null; - String apiKey = null; - //api.deletePet(petId, apiKey); + //api.deletePet(petId); // TODO: test validations - - + + } /** @@ -121,8 +108,8 @@ public class PetApiTest { //List response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -139,8 +126,8 @@ public class PetApiTest { //Set response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -157,8 +144,8 @@ public class PetApiTest { //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -173,8 +160,8 @@ public class PetApiTest { //api.updatePet(body); // TODO: test validations - - + + } /** @@ -191,8 +178,8 @@ public class PetApiTest { //api.updatePetWithForm(petId, name, status); // TODO: test validations - - + + } /** @@ -205,12 +192,12 @@ public class PetApiTest { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -227,8 +214,8 @@ public class PetApiTest { //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); //assertNotNull(response); // TODO: test validations - - + + } } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/StoreApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/StoreApiTest.java index 62fa7f486c3..7f1910cf795 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/StoreApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/StoreApiTest.java @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -52,23 +40,23 @@ import java.util.Map; * *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * API tests for StoreApi + * API tests for StoreApi */ public class StoreApiTest { private StoreApi api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", StoreApi.class, providers); org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); + + ClientConfiguration config = WebClient.getConfig(client); } @@ -86,8 +74,8 @@ public class StoreApiTest { //api.deleteOrder(orderId); // TODO: test validations - - + + } /** @@ -103,8 +91,8 @@ public class StoreApiTest { //Map response = api.getInventory(); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -121,8 +109,8 @@ public class StoreApiTest { //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -137,8 +125,8 @@ public class StoreApiTest { //Order response = api.placeOrder(body); //assertNotNull(response); // TODO: test validations - - + + } } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/UserApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/UserApiTest.java index 0aae86e82a9..9c7ddf654fd 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/UserApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/UserApiTest.java @@ -8,23 +8,12 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; import org.junit.Test; @@ -52,23 +41,23 @@ import java.util.Map; * *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * API tests for UserApi + * API tests for UserApi */ public class UserApiTest { private UserApi api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", UserApi.class, providers); org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); + + ClientConfiguration config = WebClient.getConfig(client); } @@ -86,8 +75,8 @@ public class UserApiTest { //api.createUser(body); // TODO: test validations - - + + } /** @@ -102,8 +91,8 @@ public class UserApiTest { //api.createUsersWithArrayInput(body); // TODO: test validations - - + + } /** @@ -118,8 +107,8 @@ public class UserApiTest { //api.createUsersWithListInput(body); // TODO: test validations - - + + } /** @@ -136,8 +125,8 @@ public class UserApiTest { //api.deleteUser(username); // TODO: test validations - - + + } /** @@ -152,8 +141,8 @@ public class UserApiTest { //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -169,8 +158,8 @@ public class UserApiTest { //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations - - + + } /** @@ -184,8 +173,8 @@ public class UserApiTest { //api.logoutUser(); // TODO: test validations - - + + } /** @@ -203,8 +192,8 @@ public class UserApiTest { //api.updateUser(username, body); // TODO: test validations - - + + } } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApi.java index e7e6850d979..10376b5849d 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApi.java @@ -61,11 +61,14 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId, @ApiParam(value = "" ) @HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) + public Response deletePet( @PathParam("petId") Long petId,@Context SecurityContext securityContext) throws NotFoundException { - return service.deletePet(petId,apiKey,securityContext); + return service.deletePet(petId,securityContext); } @GET @Path("/findByStatus") diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApiService.java index 5415004bc63..b357a638a01 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/PetApiService.java @@ -21,7 +21,7 @@ import javax.ws.rs.core.SecurityContext; public interface PetApiService { Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; - Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + Response deletePet(Long petId,SecurityContext securityContext) throws NotFoundException; Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 0b264cc92ce..9b62bb6feb6 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -26,7 +26,7 @@ public class PetApiServiceImpl implements PetApiService { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + public Response deletePet(Long petId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/PetApi.java index 1e2e42d17aa..94bc0769e04 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/PetApi.java @@ -52,9 +52,12 @@ public interface PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId, @ApiParam(value = "" ) @HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + public Response deletePet( @PathParam("petId") Long petId,@Context SecurityContext securityContext); @GET @Path("/findByStatus") diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 50a3d2f99c3..7ae1b892f0a 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -22,7 +22,7 @@ public class PetApiServiceImpl implements PetApi { // do some magic! return Response.ok().build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + public Response deletePet(Long petId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java index 81535f05cdd..9919c03985a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java @@ -105,10 +105,13 @@ import javax.validation.Valid; @GET @Consumes({ "application/x-www-form-urlencoded" }) @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", tags={ "fake" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - void testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + void testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); @DELETE @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake" }) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java deleted file mode 100644 index e6b87e986d3..00000000000 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - -import javax.ws.rs.*; -import javax.ws.rs.core.Response; - -import io.swagger.annotations.*; - -import java.io.InputStream; -import java.util.Map; -import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; - -@Path("/FakeClassnameTags123") -@Api(description = "the FakeClassnameTags123 API") -public interface FakeClassnameTags123Api { - - @PATCH - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", authorizations = { - @Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClassname(@Valid Client body); -} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java index 075d6931c38..70790961ae2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java @@ -39,10 +39,13 @@ import javax.validation.Valid; @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId); @GET @Path("/findByStatus") diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 810e56085b5..00000000000 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.openapitools.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - - - -public class AnimalFarm extends ArrayList implements Serializable { - - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AnimalFarm animalFarm = (AnimalFarm) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index e48ad0840ac..00000000000 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.util.HashMap; -import java.util.Map; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - - - -public class StringBooleanMap extends HashMap implements Serializable { - - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StringBooleanMap stringBooleanMap = (StringBooleanMap) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index c2dcc67b3a1..d209c4f6503 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -132,11 +132,14 @@ import javax.validation.Valid; @GET @Consumes({ "application/x-www-form-urlencoded" }) @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java index 3e02dda7d20..c52518bbeb9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java @@ -42,11 +42,14 @@ import javax.validation.Valid; @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) + @io.swagger.annotations.ApiImplicitParams({ + @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) { + public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 096e7fbf0f5..bbbc5c96bf7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -48,8 +48,6 @@ public interface AnotherFakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PATCH, value = "/another-fake/dummy", diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index ebddd5e2f74..c2d4d77391e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -57,8 +57,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/create_xml_item", @@ -89,8 +87,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", @@ -121,8 +117,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", @@ -162,8 +156,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", @@ -194,8 +186,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", @@ -225,8 +215,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Success") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-file-schema", @@ -256,8 +244,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Success") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/body-with-query-params", @@ -289,8 +275,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PATCH, value = "/fake", @@ -348,8 +332,6 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake", @@ -400,8 +382,8 @@ public interface FakeApi { @ApiResponse(code = 404, message = "Not found") }) @ApiImplicitParams({ - @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), - @ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + @ApiImplicitParam(name = "enum_header_string_array", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), + @ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") }) @RequestMapping( method = RequestMethod.GET, @@ -441,8 +423,8 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @ApiImplicitParams({ - @ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required = true, dataType = "Boolean", paramType = "header"), - @ApiImplicitParam(name = "booleanGroup", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") + @ApiImplicitParam(name = "required_boolean_group", value = "Required Boolean in group parameters", required = true, dataType = "Boolean", paramType = "header"), + @ApiImplicitParam(name = "boolean_group", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") }) @RequestMapping( method = RequestMethod.DELETE, @@ -474,8 +456,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/inline-additionalProperties", @@ -505,8 +485,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/fake/jsonFormData", @@ -541,8 +519,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "Success") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/fake/test-query-parameters" @@ -583,8 +559,6 @@ public interface FakeApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d75e7a82a97..17ce875daaa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -51,8 +51,6 @@ public interface FakeClassnameTestApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PATCH, value = "/fake_classname_test", diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 1afc4700b75..a7e7117963d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -56,8 +56,6 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/pet", @@ -95,7 +93,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid pet value") }) @ApiImplicitParams({ - @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") + @ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") }) @RequestMapping( method = RequestMethod.DELETE, @@ -135,8 +133,6 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", @@ -191,8 +187,6 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", @@ -244,8 +238,6 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", @@ -300,8 +292,6 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", @@ -338,8 +328,6 @@ public interface PetApi { @ApiResponses({ @ApiResponse(code = 405, message = "Invalid input") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", @@ -379,8 +367,6 @@ public interface PetApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 901e27289cb..1292cf4edaa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -50,8 +50,6 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.DELETE, value = "/store/order/{order_id}" @@ -84,8 +82,6 @@ public interface StoreApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/store/inventory", @@ -120,8 +116,6 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/store/order/{order_id}", @@ -167,8 +161,6 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index f3e8787a41c..8b7791294a9 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -49,8 +49,6 @@ public interface UserApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/user" @@ -78,8 +76,6 @@ public interface UserApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray" @@ -107,8 +103,6 @@ public interface UserApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList" @@ -139,8 +133,6 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" @@ -173,8 +165,6 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", @@ -221,8 +211,6 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", @@ -251,8 +239,6 @@ public interface UserApi { @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.GET, value = "/user/logout" @@ -284,8 +270,6 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @ApiImplicitParams({ - }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}" diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be..00000000000 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} -