Hi,
giving the following model JSON schema:
{
"oneOf": [
{ "required": ["email"] },
{ "required": ["username"] }
],
"properties": {
"email": { "type": "string" },
"password": { "type": "string" },
"username": { "type": "string" }
},
"type": "object"
}
If we want to PATCH one instance of this model only with the password field, we have a validation error because one of the fields (email or username) is required. Patch operations ignores the required fields. Shouldn't the oneOf required fields be ignored as well?
Thank you!
Ha, I didn't know required could be set like that. Are you sure that's a supported syntax? If it is then yes, those should be ignored as well
This syntax is supported (example in ajv documentation https://github.com/epoberezkin/ajv#filtering-data)
Ok. Thanks for bringing this up. I'll get this fixed in the next patch version.
@koskimas, any plans for releasing 0.9.3 ?
@joaonice I released 0.9.3 today
@koskimas thanks!
Most helpful comment
Ok. Thanks for bringing this up. I'll get this fixed in the next patch version.