-
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
Generate OpenAPI schema for Model properties of built-in JavaScript/Node.js types #1112
Comments
Personally, I see |
@shimks I updated the acceptance criteria in #1112 (comment), hope it clarifies the use case need to fix in this story. |
I understand that |
My opinion: If a remote method expects a date string in the input arguments, then the OpenAPI spec schema produced by LoopBack should clearly say so (so that clients understand what kind of a string to provide) and our REST layer should convert and validate the input value from string to a Date instance. |
The description doesn't contain background info for people who's new to the rest decorators. FYI, here is a blog depicts how the OpenAPI concept is applied in LB4: And also a list of related packages:
|
@loopback/repository
Fixed in #1731 |
cc @dhmlau
Description / Steps to reproduce / Feature proposal
Current Behaviour
Since
DateType
is not a class decorated by@model
, the generated OpenAPI spec doesn't generate schema for it incomponents.schemas
Expected Behaviour
automatically generate a schema entry in
components.schemas
for it.Some proposal:
jsonDef
oroai3Spec
, which one is better?Acceptance Criteria:
For a model property in Loopback type(would be the types in
@loopback/types
), we automatically generate the openapi spec for it.For example:
or a schema reference
People who works on this story can decide per type which approach is better. Types in scope:
Nice to have:
The text was updated successfully, but these errors were encountered: