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

Documentation of loopback 4 Model is incorrect #2133

Closed
opepermans opened this issue Dec 2, 2018 · 6 comments · Fixed by #3354
Closed

Documentation of loopback 4 Model is incorrect #2133

opepermans opened this issue Dec 2, 2018 · 6 comments · Fixed by #3354
Assignees
Labels

Comments

@opepermans
Copy link

Description/Steps to reproduce

Link to reproduction sandbox

Expected result

Additional information

@dhmlau
Copy link
Member

dhmlau commented Dec 5, 2018

@opepermans, could you please elaborate which part of the documentation is incorrect? Thanks!

@dhmlau dhmlau self-assigned this Dec 5, 2018
@opepermans
Copy link
Author

opepermans commented Dec 7, 2018

In https://loopback.io/doc/en/lb4/Model.html#model-decorator there is a hyperlink to https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html which describes properties that are not valid in lb4. E.g. "options" (https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html#options) was used to set the database schema while it now should be:

@model({
  settings: {
     postgresql: {
        schema: 't1'
     }
  }
})

So I think the hyperlink to https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html should be removed and instead there should be an in depth explanation of the lb4 model-decorator properties.

@dhmlau
Copy link
Member

dhmlau commented Dec 7, 2018

Thanks @opepermans. I agree some part of https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html not applicable to LB4. In fact, the ModelDefinitionSyntax (https://github.com/strongloop/loopback-next/blob/master/packages/repository/src/model.ts#L58) is the source of truth.

@dhmlau dhmlau transferred this issue from strongloop/loopback Dec 7, 2018
@dhmlau dhmlau added the Docs label Dec 7, 2018
@bajtos bajtos added the 2019Q2 label Jan 25, 2019
@emonddr
Copy link
Contributor

emonddr commented Apr 11, 2019

We need to groom this to determine if we want an lb4 version of the https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html .

@dhmlau
Copy link
Member

dhmlau commented May 4, 2019

Instead of finding which content in https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html we can reuse in LB4, I think we can think the other way round to beef up the docs for Model Decorator and Property Decorator, and see if there's anything applicable in the LB3 docs we can reuse so that we don't need to write it from scratch.

@dhmlau dhmlau removed their assignment May 4, 2019
@b-admike
Copy link
Contributor

b-admike commented May 8, 2019

Based on the discussion in this thread, I've compiled the following criteria for this issue.

Acceptance Criteria

  • Figure out what can be passed into the model decorator (top-level) and how that affects the LoopBack 4 application. Because we are using legacy juggler bridge, we need to find out if the mapping of top-level keys works OOTB. For example, does passing in @model({options:{...}}) work similar to how it does in LB3? The main keys to examine are properties, settings, options, relations because they're used often, but it'd be good to check all with a test app. Explain this in docs for Model Decorator. Use https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html as the base to compare to and document differences.
  • Figure out valid values for Property Decorator and explain them in more depth. Explore compliance with https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html#general-property-properties and document discrepancies.
  • For keys that do not work the same in LB4 as they do in LB3, create follow-up stories.

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

Successfully merging a pull request may close this issue.

6 participants