dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

[Feature] Swagger / OpenAPI support

Open Jolanrensen opened this issue 2 years ago • 3 comments

While the auto inferring of types is cool, it makes mistakes. This is logical since there are some things it just cannot know. For instance in json: What's the type of an empty list? What to do with undefined properties?

OpenApi Swagger could solve this. It exists for many APIs and essentially describes the structure of the JSON that will be expected. Generating Dataschemas from those should be a breeze.

Jolanrensen avatar Aug 08 '22 07:08 Jolanrensen

https://github.com/instructure/swagger-codegen-kotlin-retrofit-coroutines or https://github.com/swagger-api/swagger-codegen maybe something like this might help. Although I think this builds an entire library which might be a bit overkill.

From https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/ it generates: kotlin-client-client-generated.zip petstore.yaml

Alternatively: https://github.com/OpenAPITools/openapi-generator

Jolanrensen avatar Aug 08 '22 08:08 Jolanrensen

https://openapi-generator.tech/docs/generators/kotlin might actually be cool if this could be extended with dataframes as optional output type option. I'll try and see if I can create a template to generate DataSchema's

Jolanrensen avatar Aug 15 '22 12:08 Jolanrensen

might be easier to use our own json data inference, using openapi for help. A generator might be too advanced, just a library that can understand openapi might already suffice, checkout https://openapi.tools/, otherwise just do it ourselves.

Jolanrensen avatar Aug 15 '22 19:08 Jolanrensen