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

Add custom type validator to support x-ms-mutability #32

Merged
merged 1 commit into from
May 18, 2018

Conversation

vladbarosan
Copy link

The type validator was in previous z-schema versions extracted out of validators to enable fast failure for that specific failure since it was the most common.

This has been achieved in a different way in 3.22.0 and now the type validator is part of the validators so we can overwrite it.

@vladbarosan
Copy link
Author

@amarzavery if you can have a look. Tested in oav and all is good. I think the only question is if we want to introduce an extra error if read is missing in x-ms-mutability but still a property is present. If you think so I can open an issue for that.

@vladbarosan vladbarosan requested a review from amarzavery May 18, 2018 20:52
@@ -63,5 +63,56 @@ function requiredPropertyValidator (report, schema, json) {
}
}

function typeValidator (report, schema, json) {

Choose a reason for hiding this comment

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

looks good to me. indentation 2 spaces.

Copy link
Author

Choose a reason for hiding this comment

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

done

@amarzavery
Copy link

@vladbarosan -

if read is missing in x-ms-mutability but still a property is present (in the response, right? )

I am not sure if we want to do this for request objects. For response, yes raising an error would be the right thing to do.

@vladbarosan vladbarosan force-pushed the addTypeCustomValidator branch from a059476 to edc4e42 Compare May 18, 2018 21:46
@vladbarosan
Copy link
Author

@amarzavery yes this would be strictly for responses . Opened an issue here: Azure/oav#250

@amarzavery
Copy link

Feel free to merge once the CI passes.

@vladbarosan
Copy link
Author

Fixes Azure/oav#239

@vladbarosan vladbarosan merged commit 88f8f2c into Azure:validation May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants