Closed bajtos closed 3 years ago
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 CODEOWNERS
file at the top-level of this repository. This issue will be closed within 30 days of being stale.
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 CODEOWNERS
file at the top-level of this repository.
In https://github.com/strongloop/loopback-next/pull/3688, we introduced a new CLI command to import LB3 models to LB4 projects. The initial version imports only model definition, it does not import data-access and REST API layers.
In #2036, we are building solution for exposing model via (CRUD REST) API via declarative configuration.
Let's improve the importer to scaffold not only model definition, but also configuration of the public API.
How to build the LB4 configuration:
PersistedModel
is for CRUD,KeyValueModel
is for key-value,Model
is for free-form API that we don't support in LB4 yet. We need to handle inheritance though - ifCustomer
inherits fromUser
which inherits fromPersistedModel
, then import ofCustomer
needs to useCrud
pattern.inflection.pluralize
(see here). Fortunately, this is all resolved by the time a model is loaded at runtime, we can obtain the base path viamodelCtor.http.path
(see here).Acceptance criteria
TBD - will be filled by the team.