I have an API response where the property value is an array of strings, with null values allowed:
# Example API response:
{ "path": ["1", "2", null] }
With this partial schema, I'm seeing the above API response fail validation:
path:
type: array
items:
type: string
# The last item can be null to signify the participant 'passed'
nullable: true
With this error:
OpenapiFirst::ResponseInvalidError in MyController#some_action
Response body is invalid: value at `/path/2` is not a string.
I also tried this:
path:
type: array
items:
oneOf:
- type: string
nullable: true
Hopefully that makes sense, please let me know if a reproduction repro would be helpful of if this is enough context 🙏 Thanks!
I have an API response where the property value is an array of strings, with null values allowed:
With this partial schema, I'm seeing the above API response fail validation:
With this error:
I also tried this:
Hopefully that makes sense, please let me know if a reproduction repro would be helpful of if this is enough context 🙏 Thanks!