-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Helper converting Model definitions to Swagger/OpenAPI schemas #700
Comments
A thing to figure out: which version to support - Swagger (v2) or OpenAPI (v3) or both? This is related to #182 |
Hi, This probably has been discussed before, but I would go the other way around, I would define the models using the Swagger/OpenAPI schema, and generate TS interface/class to extend/implement. Please ignore this message if this has been already discussed. |
I kind of agree with @M-jerez, I would expect this helper tool give developers the flexibility to convert a Swagger style schema to any format of Model definition: either the official ModelDef style in LoopBack 4(which may change in the future) or any ModelDef flavour the users like. But IMO one of our goals is relieving users from writing Swagger schema: they define LB style model and the Swagger schema will be auto-generated accordingly and be consumed by controller(@api, or apiDef annotations). So I propose make the tool be able to convert from both directions: writing more about details, will update later... And another thing to consider: LB4 should be able to plugin other ORM |
Closing in favor of #786 |
In our Todo model example, we are duplicating information about model properties - first time in Model definition, second time in Swagger (OpenAPI) Schema.
We should have a helper function that can create Swagger/OpenAPI Schema from the Model data.
Acceptance criteria
The text was updated successfully, but these errors were encountered: