Skip to content

Patch validation fail with one of required fields #648

@joaonice

Description

@joaonice

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions