You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
Describe the bug
We have an api which has two elements in the POST. one is "createMetadata" that has few fields under it and the other "createInstruction" which is a oneOf type element with 4 objects under it. If I won't supply "createInstruction" in the payload the framework is not throwing a validation error that the element is missing.
Expected behavior
A validation error with "createInstruction" element missing should be sent back.
Additional context
N/A
To Reproduce
Steps to reproduce the behavior:
Attached the swagger that we are using for the createAPI. Import that onto your local eclipse or equivalent environment.
Pass the below payload to the framework along with the above swagger.
{
"createMetadata": {
"initiatorReferenceId": "123",
"type": "directCreate",
"authNumber": "123456",
"createDate": "2020-11-01",
"individual": false,
"createCount": 3,
"numberOfSignatories": 1,
"hashTotal": "345678"
}
}
You should notice validation successful instead of a validation failure message.
It is working fine as I was checking the validation results size to be greater than 0. Apologies. But for types of payloads under createInstruction, validationResults is giving the below error "body.createInstruction: More than 1 schema is valid."
is that how it supposed to work? and do I need to ignore that message each time with oneOff scenario? Thanks.
OneOf keyword stands for 'only one schema must be valid'. If you have multiple valid schemas, use AnyOf instead.
Closing the issue since this is not related to the tool.
Version
1.0.4
Describe the bug
We have an api which has two elements in the POST. one is "createMetadata" that has few fields under it and the other "createInstruction" which is a oneOf type element with 4 objects under it. If I won't supply "createInstruction" in the payload the framework is not throwing a validation error that the element is missing.
Expected behavior
A validation error with "createInstruction" element missing should be sent back.
Additional context
N/A
To Reproduce
Steps to reproduce the behavior:
{
"createMetadata": {
"initiatorReferenceId": "123",
"type": "directCreate",
"authNumber": "123456",
"createDate": "2020-11-01",
"individual": false,
"createCount": 3,
"numberOfSignatories": 1,
"hashTotal": "345678"
}
}
Let me know if you need any further details.
Reproducer
N/A
CreateAPI.yaml.zip
The text was updated successfully, but these errors were encountered: