-
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
Use OpenAPI v3 spec to coerce primitives in query, path and headers #750
Comments
@kjdelisle and me agreed to remove Validation from MVP scope. The current validation performed by Juggler should be good enough for CRUD applications which are our MVP target. |
Explicitly cast path parameter "id" from string to number because the REST transport does not implement parameter coercion yet. See #750 This change removes the following warnings from `npm test` output: WARNING: id property cannot be changed from 3 to 3 for model:Todo in 'before save' operation hook WARNING: id property cannot be changed from 3 to 3 for model:Todo in 'loaded' operation hook
Explicitly cast path parameter "id" from string to number because the REST transport does not implement parameter coercion yet. See #750 This change removes the following warnings from `npm test` output: WARNING: id property cannot be changed from 3 to 3 for model:Todo in 'before save' operation hook WARNING: id property cannot be changed from 3 to 3 for model:Todo in 'loaded' operation hook
Explicitly cast path parameter "id" from string to number because the REST transport does not implement parameter coercion yet. See #750 This change removes the following warnings from `npm test` output: WARNING: id property cannot be changed from 3 to 3 for model:Todo in 'before save' operation hook WARNING: id property cannot be changed from 3 to 3 for model:Todo in 'loaded' operation hook
|
@jannyHou in addition to the list you have above, there should be a test for each OAS type to verify how the following input values are handled:
|
closing it after 2 PRs checked in |
Story
As a LoopBack4 user, I would like to be able to validate primitive types in my http request.
connected to #118
Acceptance Criteria
Notes
We should consider using either strong-remoting or AJV to perform the coercion
packages/example-getting-started/src/controllers/todo.controller.ts
should be updated to remove the manual coercion once this issue is fixed! (Also update the related docs for the tutorial!)Coercion is closely related to validation, see #118
A list of coming PRs for edge cases:
Edge cases that should apply to all types:
The text was updated successfully, but these errors were encountered: