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
While running prism mock server with OpenApi 3.0 specification a nullable field is returned with the value "string" instead of null in the HTTP response body.
Context
The OpenApi spec https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json is as follows:
When running request curl -s -D "/dev/stderr" http://127.0.0.1:4010/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json -u aaa:aaa | json_pp I get the response:
While running prism mock server with OpenApi 3.0 specification a nullable field is returned with the value
"string"
instead ofnull
in the HTTP response body.Context
The OpenApi spec
https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json
is as follows:Current Behavior
When running request
curl -s -D "/dev/stderr" http://127.0.0.1:4010/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json -u aaa:aaa | json_pp
I get the response:price_unit
(and other nodes as well) value is"string"
.Expected Behavior
The value for the nullable fields should be null if no default or example values are specified as per the documentation: https://github.com/stoplightio/prism/blob/master/docs/guides/01-mocking.md#static-response-generation
Possible Workaround/Solution
Workaround: adding a default value in the spec works.
Steps to Reproduce
prism mock https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json
curl -s -D "/dev/stderr" http://127.0.0.1:4010/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json -u aaa:aaa | json_pp
Environment
The text was updated successfully, but these errors were encountered: