Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Enhance the existing code generator to use the OpenAPI spec as the input format #348

Closed
harshavamsi opened this issue Apr 4, 2023 · 1 comment · Fixed by #412 or #467
Assignees
Labels
enhancement New feature or request

Comments

@harshavamsi
Copy link
Collaborator

Is your feature request related to a problem?

As part of an existing campaign to generate clients off of specs, we'd like to generate new APIs in the python client from an OpenAPI spec. The current generator makes use of the legacy rest-api-spec that is published in core opensearch. There are other initiatives that will convert the rest-api-spec into OpenAPI specs through a translation layer, but for the purposes of this client we'd like to do a re-write on the existing generator to inject OpenAPI.

What solution would you like?

A rewrite of the current generator to ingest OpenAPI specs and output API endpoints into the client.

What alternatives have you considered?

Some alternatives could be to make use of the existing rest-api-spec and continue using the generator as is. But this is out of the scope of consideration as the spec was written to suit a particular use-case that is no longer relevant. OpenAPI specs are the industry standard for JSON based schemas. We've already seen an experimental schema + generator written for the OpenSearch-Java client[1] that replicates what we intend to do for the python client.

Another alternative would be to use the built in generator from either OpenAPI[2] or an accompanying python specific generator written for the OpenAPI spec[3]. This approach has drawbacks in the sense that they are not customizable to our needs. The current API layer is heavily opinionated in the way it is written, and using a generator from scratch would mean a lot of breaking changes in the function signatures, imports, tests, etc. We would like the initial approach to remain as close to the current API model as possible, and allow for a gradual overhaul of all the missing APIs and methods. Re-wiring the current generator allows us to do just that.

Do you have any additional context?

[1] opensearch-project/opensearch-java#366
[2] https://github.com/OpenAPITools/openapi-generator
[3] https://github.com/MarcoMuellner/openapi-python-generator

@saimedhi
Copy link
Collaborator

I am working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment