openapi: 3.0.0
paths:
/aggregationtypes:
get:
responses:
"200":
description: OK
content:
"*/*":
schema:
items:
$ref: "#/components/schemas/AggregationTypeDTO"
type: array
"401":
description: Authorization token missing or invalid.
"404":
description: added by me -RD
"500":
description: Unknown Error.
tags:
- aggregationtypes
operationId: GetAggregationTypes
summary: Returns a collection of AggregationTypeDTO
As you can see in the above specification 401, 404, 500 responses have no content, which is valid OpenAPI specification (https://swagger.io/docs/specification/describing-responses/). But when I call this Get request I get the following error for cases when status code is 401 or 404:
Traceback (most recent call last):
File "C:/working/openapi3/my_main.py", line 49, in <module>
main()
File "C:/working/openapi3/my_main.py", line 16, in main
make_http_requests(api, get_list)
File "C:/working/openapi3/my_main.py", line 36, in make_http_requests
response = function()
File "C:\working\openapi3\openapi3\openapi.py", line 193, in __call__
**kwargs)
File "C:\working\openapi3\openapi3\paths.py", line 266, in request
expected_media = expected_response.content.get(content_type, None)
AttributeError: 'NoneType' object has no attribute 'get'
As you can see in the above specification 401, 404, 500 responses have no content, which is valid OpenAPI specification (https://swagger.io/docs/specification/describing-responses/). But when I call this Get request I get the following error for cases when status code is 401 or 404: