Skip to content
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

[@loopback/sequelize] Nested Loopback model types are not supported #9766

Open
KalleV opened this issue Jul 17, 2023 · 0 comments
Open

[@loopback/sequelize] Nested Loopback model types are not supported #9766

KalleV opened this issue Jul 17, 2023 · 0 comments

Comments

@KalleV
Copy link
Contributor

KalleV commented Jul 17, 2023

Describe the bug

If you have existing Loopback model properties set up that are nesting other Loopback models such as this "Address" example:

it('allows nesting models', () => {
@model()
class Address {
@property()
street: string;
@property()
city: string;
@property()
state: string;
}
@model()
class Email {
@property()
label: string;
@property()
id: string;
}
@model()
class User {
@property({id: true})
id: string;
@property({
type: 'string',
required: true,
})
name: string;
@property({
type: Address,
})
address?: Address;
@property.array(Email)
emails: Email[];
}
it will lead to an error about unsupported types.

Logs

Example error:

Error: Unhandled DataType "class Address extends repository_1.Model {
  }" for column "address" in sequelize extension

Additional information

References:
https://loopback.io/doc/en/lb4/Model.html#json-schema-inference

Reproduction

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants