This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAML 0.8 and RAML 1.0 should now work seamlessly through AMF Model.
It's not yet working because it required raml-path-match to be reworked to use new raml-sanitize API.
jstoiko
reviewed
Jul 13, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major changes:
(...)
- Changed errors format;
it would be nice to explain the rational behind this change (i.e. why it was needed) and what this change implies for the end-users.
Updated the issue description to describe error format change in detail. Please let me know if the update looks good. |
This behaviour was ported from the old version of osprey-method-handler. The check limited body schema types which were validated in jsonBodyHandler to Scalar, Node, Array only. The issue was discovered when trying to validate a body of type Union. The validation just did not happen because the body schema was ignored as it didn't pass the check. Now the check is completely removed as it doesn't seem to make sense. As jsonBodyHandler is only called for application/json requests, all the request bodies defined in RAML for application/json should work well with validation.
jstoiko
reviewed
Jul 14, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major changes:
webapi-parser
;webapi-parser
;RAMLVersion
(now inferred automatically);webapi-parser.Operation
object as first argument, path string as second argument, method name as third and options object as final argument;Minor changes:
const/let
instead ofvar
;Making a release:
PR depends on:
To test the PR locally with all the reworked Osprey sub-dependencies, use this Makefile.
Error format change
The new version changes the errors response format for RAML and JSON Schema validation errors. The new errors responses are more uniformal and descriptive while at the same time being less verbose. The change is caused by the fact that a different parser is used to parse RAML specs, which in turn produces a different parsed document model.
Let's explore the changes on body validation examples.
JSON Schema validation example responses
Number value is greater than the "maximum":
Old:
New:
Less properties than "minProperties":
Old:
New:
RAML validation responses examples
Number value is greater than the "maximum":
Old:
New:
Less properties than "minProperties":
Old:
New: