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
Hi! First of all great library, and we have been using it extensively for validating our request/responses between our microservices. Works great with objects, but if my response is of type string, which is a valid json, the library misbehaves with that. Allow me to explain with an example:
If my schema looks something like this:
Validation succeeds, but I lose the json-ness of the string. It just tries to return as a normal string in response even though content type is set to json.
I looked at the code and the issue seems to be that the response body is being parsed from JSON, but not being stringified in sendData.
I have a potential fix for this too, but wanted to run by the issue first and see if there is anything which I am doing wrong here.
The text was updated successfully, but these errors were encountered:
Hi! First of all great library, and we have been using it extensively for validating our request/responses between our microservices. Works great with objects, but if my response is of type string, which is a valid json, the library misbehaves with that. Allow me to explain with an example:
If my schema looks something like this:
And my api for this path looks like this:
Validation succeeds, but I lose the json-ness of the string. It just tries to return as a normal string in response even though content type is set to json.
I looked at the code and the issue seems to be that the response body is being parsed from JSON, but not being stringified in
sendData
.I have a potential fix for this too, but wanted to run by the issue first and see if there is anything which I am doing wrong here.
The text was updated successfully, but these errors were encountered: