core-api / python-openapi-codec

An OpenAPI codec for Core API.
Other
33 stars 35 forks source link

Add better handling of Arrays and Objects #43

Open winsmith opened 7 years ago

winsmith commented 7 years ago

The _get_parameter method now handles arrays and objects slighlty better. Before, it would simply output type string for arrays, whereas now it tries to inspect objects and arrays in order to output type information for them.

This change enables slightly more helpful display of nested serializers when using e.g. Django-Rest-Framework with django-rest-swagger.

This is not recursive, so it goes only one level deep, but right now I can't see an easy way to achieve that.

korbinianfritsch commented 7 years ago

Included this into a project of mine and it helps getting a better understanding of the rendered schema, for example in django-rest-swagger.

+1 for tackling this.

xxmatyuk commented 7 years ago

+1 but tried to do the same here so far with no luck of attention or understanding. But works good for me.