The OpenAPI specification allows responses of the form 2XX, 4XX, etc. Using this library, it's possible in a docstring to write something like this:
responses:
200:
content:
application/json:
schema: GoodResponseSchema
4XX:
content:
application/json:
schema: RequestErrorSchema
This causes the following error:
File "/Users/zach/.pyenv/versions/3.6.5/lib/python3.6/json/encoder.py", line 353, in _iterencode_dict
items = sorted(dct.items(), key=lambda kv: kv[0])
TypeError: '<' not supported between instances of 'str' and 'int'
Which happens because the 200 key is stored as an int, and the 4XX key is stored as a string. A preprocessing step to make them all strings would fix that problem.
The OpenAPI specification allows responses of the form 2XX, 4XX, etc. Using this library, it's possible in a docstring to write something like this:
This causes the following error:
Which happens because the
200key is stored as anint, and the4XXkey is stored as a string. A preprocessing step to make them all strings would fix that problem.