-
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
bug(cli): type is missing when using type alias for string #4211
Comments
Please try to add |
I see two aspects here:
@property({
id: true,
type: 'string',
generated: true,
jsonSchema: {
pattern: PATTERN_UUID,
},
})
id?: UUID; The second item above opens an interesting question - how to allow developers to create custom property types that can provide both TypeScript typings but also LB4 property metadata? Ideally, the part |
I had a look into my transpiled files now - the design type is |
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Steps to reproduce
I've defined a type alias
export type UUID = string;
to be used whenever a UUID is used. This helps the developers to easily read the application code and understand which type of string is expected there.Id's in Models are defined this way:
When creating controller code by
lb4 relation
, the type of theID
is not correctly resolved.Current Behavior
When using
lb4 relation
the cli does not correctly resolve the type of theID
, something like this is generated:Expected Behavior
If possible, resolve to native types !?
Additional information
@loopback/cli version: 1.26.0
The text was updated successfully, but these errors were encountered: