-
Notifications
You must be signed in to change notification settings - Fork 10
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
Generic definitionPointer #14
Comments
Hi, what you are trying to do is currently not possible. I'm not sure I understand your example though. Is a User also a Data and a History? The definitions are all the same in your example, so validating against any of them should be enough. |
Yeah, that was a shortcut from my side. Maybe I'll try with something more concrete, let's say I have to validate object with nested validation rules. Object result is inside response object. How to perform a validation in this case to cover validation rules reference?
|
It should work with It works fine with the following spec: {
"swagger": "2.0",
"info": {
"title": "Sample API",
"version": "1"
},
"definitions": {
"Response": {
"type": "object",
"required": [
"asyncRequestId",
"result"
],
"properties": {
"asyncRequestId": {
"type": "string"
},
"beginTime": {
"type": "string",
"format": "date-time"
},
"endTime": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"result": {
"$ref": "#/definitions/AsyncResult"
},
"sceuid": {
"type": "string"
},
"type": {
"type": "string"
},
"userId": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"AsyncResult": {
"type": "object",
"properties": {
"status": {
"type": "string"
}
}
}
}
} and the following sample: {
"asyncRequestId": "qsdf",
"result": {
}
} If the reference points to a definition located in an external file, the validation will fail (see #3). |
If I set
-> it works as expected |
Everything works perfectly, thank you. |
Hi, I've just implemented your validator and I have one problem.
Lets say I've got huge JSON swagger definition with multiple properties. Simplified example below.
I want to perform a validation for whole JsonSchema printed above without specification which object of definitions should be validated.
Now, I have to run them explicitly
Is there any possibility to pass definitionPointer argument which validates whole schema?.
Thank you in advance,
Kacper
The text was updated successfully, but these errors were encountered: