sqlathanor icon indicating copy to clipboard operation
sqlathanor copied to clipboard

Serialization to Documentation / JSON Schema / OpenAPI / apispec integration

Open insightindustry opened this issue 6 years ago • 4 comments

Does it make sense to support serialization to (and maybe deserialization from) various documentation formats, including possibly OpenAPI (Swagger)?

If so, does it make sense to integrate with documentation platforms like Sphinx or apispec?

What additional metadata support would be necessary, if any?

insightindustry avatar Aug 11 '18 01:08 insightindustry

On further consideration, it does not make sense to try to serialize model class metadata to RST or Sphinx. The reason is actually pretty obvious: a model class is already a regular Python class, and so can be documented normally the way one would document anything with docstrings. So built in Sphinx support, by definition.

insightindustry avatar Aug 11 '18 18:08 insightindustry

However, serializing SQLAlchemy model classes to OpenAPI does make sense, and can definitely provide value.

Some further research should be done to figure out the best architecture and API for supporting this functionality.

insightindustry avatar Aug 11 '18 18:08 insightindustry

Slight tweak to also support the serialization of a table structure to / from JSON Schema.

insightindustry avatar Jan 08 '21 20:01 insightindustry

Slight tweak to also support the serialization of a table structure to / from JSON Schema.

IMO this would be very valuable as this would allow people not knowing Python & SQLAlchemy to prepare config files with complete "create table" DDL statements in a simplified form (for example in YAML).

max-uzunov avatar Jan 09 '21 12:01 max-uzunov