-
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
[SPIKE] HasMany relation definition to REST API with auto-generated repository/controller classes #3896
Comments
@bajtos ^ |
Team has different opinions on the how to resolve the relational path. Copied from #2855
And @bajtos 's reply in #2483 (comment):
Let's make a decision in this spike for ^ |
@emonddr those acceptance criteria make sense for the real implementation. Spike stories have different goals, we want to explore & experiment with different approaches without having to pay the cost of full test coverage & docs. Here is a better list based on #2738:
I am going to update acceptance criteria with the list. |
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 |
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 |
In LoopBack 3, it is very easy to get a fully-featured relational REST API with very little code: a model definition describing model relations + a model configuration specifying which datasource to use.
Let's enhance the solution provided by #2036 to include support for relations too.
This spike will focus on the
hasMany
relation, and will serve as an example of how to approach the other relations (supported by LB4).User creates a model class and uses decorators to define a
hasMany
model relationUser declaratively defines what kind of data-access patterns to provide (CRUD, KeyValue, etc.) and what datasource to use under the hood - will be provided by From model definition to REST API with no custom repository/controller classes #2036
@loopback/boot processes this configuration and registers appropriate repositories & controllers with the app.
Acceptance criteria
A design proposal and PoC implementation showing how can extensions contribute changes needed to expose relation APIs, e.g. register inclusion resolvers and expose new controller methods. This should build on top of From model definition to REST API with no custom repository/controller classes #2036 (see also the proposal from spike Spike: booter for creating REST APIs from model files #3617).
Updated
examples/todo-list
showing the proposed solution in practice. You can use the modifications from Spike: booter for creating REST APIs from model files #3617 to convert the current todo-list app to leverage ModelApiBooter.A spike document (a markdown file in your spike branch) explaining the proposal, documenting which different options were considered (and why they were rejected), etc. The document should also outline follow-up implementation tasks.
The text was updated successfully, but these errors were encountered: