-
Notifications
You must be signed in to change notification settings - Fork 62
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
Generate missing models from legacy spec #82
Comments
GoalsWe chose maintaining OpenSearch API Spec via Smithy, even though the end-result is standard OpenAPI spec, mainly for its maintainability. So, the generated Smithy Spec should take advantage of Smithy unique features while assure that the models can still be properly translated to OpenAPI:
Problems and SolutionsI came across many problems of various sizes while converting the legacy spec to Smithy. They are listed here for discussion. Parameter naming collisionsThe vast majority of parameters appear in more than 1 action. However, a large portion of parameters, though have the same name, have different shapes, which cause name collisions when translated to shared Smithy models:
The grouping of Operations into ActionsThe fact that one action can have multiple operations causes a few issues:
Default values hidden in descriptionsMany parameters do not explicitly state their default values in the legacy spec but mention the defaults in the descriptions. These values are extracted programmatically using regex when the pattern is clear, and manually added when not. Extra meta dataSome meta data was added to the smithy models via
|
@nhtruong the choice of Smithy is still not obvious, specifically taking into account plugins and extensions, I believe there are compelling arguments to use OpenAPI 3.0+ directly [1], without Smithy shim. |
@reta I'm still drafting this comment and accidentally hit As discussed in #80, the end result will be OpenAPI 3.1. We're only using smithy, for now at least, as a device to backfill missing info (like Output schemas, and Body schemas), because it's easier to do so via Smithy than OpenAPI. |
Reopening this issue, since there is a part 2 for the PR. |
This spawns from #80
Basically use legacy spec to generate smithy models so we don't have to fill out 308 operations by hand.
The translator code can be found here: https://github.com/nhtruong/opensearch-smithy-spec-translator
The text was updated successfully, but these errors were encountered: