aiohttp-swagger icon indicating copy to clipboard operation
aiohttp-swagger copied to clipboard

generate_doc_from_each_end_point() should sort keys for defaul json

Open grigi opened this issue 7 years ago • 0 comments

This allows the swagger spec to look consistent when generated off endpoints. This is especially useful on Python3.5

I understand CPython3.6 and Python3.7+ specifies ordered dictionaries, but it would be great to at worst have an option to sort the items alphabetically.

Just changing generate_doc_from_each_end_point() to return

return json.dumps(swagger, sort_keys=True)

makes a big difference for me.

grigi avatar May 15 '18 07:05 grigi