-
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
@param.path generated with lb4 relation considers Wrapper datatypes #3711
Comments
@basavarajvs, what's your id property look like in your model class?
|
@dhmlau dhmlau
The generated controller looks like this
The associated repository looks like this
Please do let me know if you need additional info |
@param.path.String('id') id: typeof Rolesinsaas.prototype.accntid, should be @param.path.string('id') id: typeof Rolesinsaas.prototype.accntid, (note the uppercase S vs the lowercase one) |
Yes thats the problem with Auto generated code.. on running "lb4 relation". |
I think this is a bug in the code generating LB4 property definitions from metadata provided by discovery (which is LB3 based). I encountered a similar problem while implementing I think we should find a way how to share more code between We are already sharing and Any volunteers to contribute the changes and fix the problem? See Contribute to LoopBack 4 and Submitting a pull request to LoopBack 4 to get started. |
Duplicate of #3806 |
I am not sure, we will need to double-check. |
Verified with the new merged fix for #3806 : |
So the related code is the Typescript type: @property({
// The type here doesn't affect
type: 'number',
id: true,
})
// The ts type specified for the property affects the generated controller file
// if you put `id?: Number` here, `lb4 relation` generates `@param.path.Number` which is invalid
id?: number; I believe we can close this story as a dup of #3806. cc @bajtos WDYT? This issue should be fixed with a new release(coming soon). |
Fixed in the latest release of @loopback/cli@1.26.0, I am closing this issue 👏 |
Steps to reproduce
Current Behavior
The controller files are generated with methods which have reference to String wrapper under the @param.path
This is causing an error to be thrown on npm start
Also the
parameter.decorator.d.ts
file does not contain a reference to the String wrapper data type.Expected Behavior
lb4 relations should generate
@parameter.path.<type>
using only the supported data types and not wrapper classes.or
parameter.decorator.d.ts
file should support wrapper data types for String, NumberLink to reproduction sandbox
Additional information
Related Issues
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: