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鈥檒l 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

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 strongloop-internal/scrum-asteroid#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 馃憟

feat(booter-lb3app): enable operation-scoped model schemas
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

@bajtos bajtos requested a review from raymondfeng as a code owner May 2, 2019

@bajtos bajtos self-assigned this May 2, 2019

@nabdelgadir
Copy link
Contributor

left a comment

LGTM 馃憤

@hacksparrow hacksparrow self-requested a review May 3, 2019

@bajtos bajtos merged commit ff014fc into master May 3, 2019

5 checks passed

clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 91.356%
Details

@bajtos bajtos deleted the feat/lb3-operation-scoped-schema branch May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.