-
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
Allow controllers to provide definitions of models referenced in operation spec #2629
Comments
@bajtos , we would like to know if the
Shouldn't |
@bajtos ^ . Thank you. |
@bajtos , please see our question above. Thank you :) |
Ah, this is a very good question indeed! The high-level goal of this story is to allow controller authors to tell LoopBack that the method wants to reference a shared model schema instead of inlining the schema in every place it's used. For example, both Now in OpenAPI, shared schemas are stored in I don't recall now why did I use
Personally, I don't really mind which approach ( I am proposing to make this decision as part of the implementation. If we decide to change the schema format, then we need to update the description of |
The proposal only allows operation-level definitions. We should also allow class level definitions available for re-use across multiple operations. |
That's out of scope of this user story, unless it's trivial to implement. Let's avoid scope creep please. |
Description / Steps to reproduce / Feature proposal
Allow controller methods to reference model schema directly via OpenAPI spec, without requiring them to use
x-ts-type
extension. Extend support for propagating definitions of references models, so that this feature is available to all operations using$ref
instead ofx-ts-type
.Consider the following test in
@loopback/openapi-v3
:Current Behavior
The test fails:
Expected Behavior
The test passes.
See the spike #2592 and especially the commit d93dff7 for more details . Please note the commit shows changes before the review feedback was applied. You need to review the final pull request diff of the PoC before copying any code over.
Acceptance criteria
The text was updated successfully, but these errors were encountered: