-
Notifications
You must be signed in to change notification settings - Fork 107
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] Generate API code from OpenSearch API Spec #284
Comments
I would like to help with this issue. Is it still relevant? |
Hi @tannerjones4075, yes absolutely! The first step would be use to the API specs from https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json and modify the existing non-functional generator in the go client to create code similar to the existing client. The general idea is to replace all the code (module by module or divided in whatever way works) in this repo for the APIs with code generated from the API specs without breaking the users. |
I am currently trying to generate sturcts out of the component schemas and I don´t think I can continue at this point.
For example: Should I open an issue for that in the api spec repository? @dblock Another issue that we might be able to handle is the use of Some more information: |
First, I'm really glad to see you look into this @Jakob3xD!
If you see bugs/issues in the spec you can/should fix them or open issues, absolutely yes, please. We inherited a lot from Elastic.
Either the spec is incorrect or the spec is correct and we should handle it. Feel free to open an issue if you're unsure, as always.
You're definitely right. I opened opensearch-project/opensearch-api-specification#423, but in general please don't hesitate to open issues even if you're unsure.
One way you can handle this is to roll out custom types without having to parse it or always narrow it down to a primitive type. If something is of
Right. LMK which specific issues are blocking you and I will look into them. |
To give an update, to better understand the issue and my last comment. ByteSizeI remove the ByteSize type in the openapi spec and replaced it with a string type component and an integer type component to remote the anyOf reference. "Old" fields
Looking deeper I notices this statement is false. The fields still exists but are "hidden" behind the human parameter. PercentagI haven't looked into the NullThe nullable field got removed in favor of the null type. opensearch-project/opensearch-api-specification#436 Issues (i currently know of)
|
Is your feature request related to a problem?
Related to opensearch-project/opensearch-clients#19
What solution would you like?
Re-use the generator that generates API Code that maintains backwards compatibility with the current client APIs and provides a way to add new APIs.
What alternatives have you considered?
Using OpenAPI generators instead of re-using the existing generator but it makes it difficult to maintain backwards compatibility.
Do you have any additional context?
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: