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

feat(booter-lb3app): enable operation-scoped model schemas #2823

Merged
merged 1 commit into from
May 3, 2019

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented May 2, 2019

LB3 models with forceId: true require request bodies for CREATE operations to exclude the primary key (id property), because the value is always generated by the database (e.g. as auto-incremented number, or as a UUID/GUID value).

This patch turns on a loopback-swagger feature flag to describe this constraint in the emitted Swagger spec. See the internal story https://github.com/strongloop-internal/scrum-asteroid/issues/283 and the following LB3 pull requests:

I tested the change using LB3 example application from #2803.

The create endpoint for User model DOES NOT accept "id" property now:

Screen Shot 2019-05-02 at 12 34 19

The patchOrCreate endpoint for User model DOES accept "id" property as before:

Screen Shot 2019-05-02 at 12 34 51

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

LB3 models with `forceId: true` require request bodies for CREATE
operations to exclude the primary key (id property).

This commit turns on a loopback-swagger feature flag to describe this
constraint in the emitted Swagger spec.
@bajtos bajtos added this to the May 2019 milestone milestone May 2, 2019
@bajtos bajtos requested a review from nabdelgadir May 2, 2019 10:38
@bajtos bajtos requested a review from raymondfeng as a code owner May 2, 2019 10:38
@bajtos bajtos self-assigned this May 2, 2019
Copy link
Contributor

@nabdelgadir nabdelgadir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@hacksparrow hacksparrow self-requested a review May 3, 2019 06:34
@bajtos bajtos merged commit ff014fc into master May 3, 2019
@bajtos bajtos deleted the feat/lb3-operation-scoped-schema branch May 3, 2019 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants