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

Adds redirection response deserialization as non-error #152

Merged
merged 3 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
### Operation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Responses_HttpStatusCode|✓|OAS2,OAS3
|Responses_RangedResponseCodes|✗|OAS2,OAS3
|Responses_Default|✓|OAS2,OAS3
|Responses_HttpStatusCode|✓|OAS3
|Responses_RangedResponseCodes|✗|OAS3
|Responses_Default|✓|OAS3
|Responses_RedirectionResponse|✗|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
7 changes: 4 additions & 3 deletions docs/generators/jaxrs-jersey.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
### Operation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Responses_HttpStatusCode|✓|OAS2,OAS3
|Responses_RangedResponseCodes|✗|OAS2,OAS3
|Responses_Default|✓|OAS2,OAS3
|Responses_HttpStatusCode|✓|OAS3
|Responses_RangedResponseCodes|✗|OAS3
|Responses_Default|✓|OAS3
|Responses_RedirectionResponse|✗|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
7 changes: 4 additions & 3 deletions docs/generators/jmeter.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
### Operation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Responses_HttpStatusCode|✓|OAS2,OAS3
|Responses_RangedResponseCodes|✗|OAS2,OAS3
|Responses_Default|✓|OAS2,OAS3
|Responses_HttpStatusCode|✓|OAS3
|Responses_RangedResponseCodes|✗|OAS3
|Responses_Default|✓|OAS3
|Responses_RedirectionResponse|✗|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
7 changes: 4 additions & 3 deletions docs/generators/kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
### Operation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Responses_HttpStatusCode|✓|OAS2,OAS3
|Responses_RangedResponseCodes|✗|OAS2,OAS3
|Responses_Default|✓|OAS2,OAS3
|Responses_HttpStatusCode|✓|OAS3
|Responses_RangedResponseCodes|✗|OAS3
|Responses_Default|✓|OAS3
|Responses_RedirectionResponse|✗|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
7 changes: 4 additions & 3 deletions docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
### Operation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Responses_HttpStatusCode|✓|OAS2,OAS3
|Responses_RangedResponseCodes|✓|OAS2,OAS3
|Responses_Default|✓|OAS2,OAS3
|Responses_HttpStatusCode|✓|OAS3
|Responses_RangedResponseCodes|✓|OAS3
|Responses_Default|✓|OAS3
|Responses_RedirectionResponse|✓|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
* Defines Operation features supported in the generated code.
*/
public enum OperationFeature {
/**
* Supports header-based basic http auth.
*/
@OAS2 @OAS3
@OAS3
Responses_HttpStatusCode,

@OAS2 @OAS3
@OAS3
Responses_RangedResponseCodes,

@OAS2 @OAS3
@OAS3
Responses_Default,

@OAS3
Responses_RedirectionResponse,
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ public PythonClientCodegen() {
ParameterFeature.Content
)
.includeOperationFeatures(
OperationFeature.Responses_RangedResponseCodes
OperationFeature.Responses_RangedResponseCodes,
OperationFeature.Responses_RedirectionResponse
)
.excludeParameterFeatures(
ParameterFeature.In_Cookie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ public Map<String, CodegenResponse> getNonErrorResponses() {
HashMap<String,CodegenResponse> nonErrorResponses = new HashMap<>();
if (statusCodeResponses != null) {
for (Map.Entry<Integer, CodegenResponse> entry: statusCodeResponses.entrySet()) {
if (entry.getKey() >= 200 && entry.getKey() <= 299) {
if (entry.getKey() >= 200 && entry.getKey() <= 399) {
nonErrorResponses.put(entry.getKey().toString(), entry.getValue());
}
}
}
if (wildcardCodeResponses != null) {
for (Map.Entry<Integer, CodegenResponse> entry: wildcardCodeResponses.entrySet()) {
if (entry.getKey() == 2) {
if (entry.getKey() == 2 || entry.getKey() == 3) {
nonErrorResponses.put(entry.getKey().toString(), entry.getValue());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class BaseApi(api_client.Api):
{{/if}}
{{/if}}

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,17 @@ paths:
content:
application/json:
schema: {}
/fake/redirection:
get:
operationId: redirection
summary: operation with redirection responses
tags:
- fake
responses:
303:
description: see other
3XX:
description: 3XX response
servers:
- url: 'http://{server}.swagger.io:{port}/v2'
description: petstore server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class instances
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)

if not 200 <= response.status <= 299:
if not 200 <= response.status <= 399:
raise exceptions.ApiException(
status=response.status,
reason=response.reason,
Expand Down
Loading