-
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
docs: update model decorator #3354
Conversation
e5db215
to
4b75e80
Compare
4b75e80
to
5919ba1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great initiative!
Let's make sure the documentation matches the actual implementation.
For settings that are documented as supported, it would be great to have tests to verify. Preferably in repository-tests package, so that we can run them against different connectors.
I understand writing such tests may be out of scope of this pull request. I am ok to leave them out as long as you create a follow-up GH issue.
The strict
settings is already covered by tests, see packages/repository-tests/src/crud/freeform-properties.suite.ts
@agnes512 great discussion! I think in general, it's important to realize that in LB4, each model has two parallel classes:
Because of this design, not all settings offered by juggler will actually work in LoopBack 4. You may ask why we have this complexity? The legacy juggler bridge is a (temporary) solution allowing us to implement BTW I am pretty sure you are not the last person to be caught by surprise about this design, it would be great if you could document what you have learned about this problem domain. For example, we can add |
bdd4af7
to
fe6c6ca
Compare
d16e9b7
to
ae22a6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, I have few minor comments to consider.
ae22a6e
to
9a9ac29
Compare
c47da6c
to
811015c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice writeup 👍
811015c
to
6f84825
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
6f84825
to
4357c38
Compare
4357c38
to
478d44b
Compare
Resolves #2133
Update inconsistent docs for
@model
and@property
decorators part.By testing out the code in
loopback-datasource-juggler/lib/datasource.js
,loopback-datasource-juggler/lib/model-builder.js
,legacy-juggler-bridge
, I made following changes:@model
decorator:( I copied the available part of the table from lb3 site and made a bit change on the content. Because I think checking sites back and forth is kind of annoying.)
settings
entries in model decorator. Andtop-level-properties
in lb3 now are passed insettings
.@property
decorator.options
,acls
are not available in lb4 yet.Not sure why we don't supportWe already have that issue opened.options
. Will open an issue for this part.@hasMany
.@property
decorator:Since this part is the same as lb3, I only made slight change.
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈