Skip to content
Snippets Groups Projects
  • hackerman's avatar
    5df8f20c
    Resolve issue with required field in oneOf (#534) · 5df8f20c
    hackerman authored
    Having a schema that has a oneOf definition as such:
    
    ```
    {
      "oneOf": [
        { required: ["foo"], /*...*/ },
        { /*...*/ },
      ]
    }
    ```
    
    causes the changed line to fail with error message `calling includes on undefined`. This does not always happen, as it appears that the "oneOf" field is being picked by random.
    
    This patch simply uses a default empty array if `fixed.required` is undefined, resolving this issue.
    5df8f20c
    History
    Resolve issue with required field in oneOf (#534)
    hackerman authored
    Having a schema that has a oneOf definition as such:
    
    ```
    {
      "oneOf": [
        { required: ["foo"], /*...*/ },
        { /*...*/ },
      ]
    }
    ```
    
    causes the changed line to fail with error message `calling includes on undefined`. This does not always happen, as it appears that the "oneOf" field is being picked by random.
    
    This patch simply uses a default empty array if `fixed.required` is undefined, resolving this issue.