Skip to content

Conversation

@joshkel
Copy link

@joshkel joshkel commented Nov 10, 2025

What's the problem this PR addresses?

"type": "mixed" is not valid JSON Schema. This results in errors in features such as VS Code's automatic validation:

Schema 'Yarn Config (.yarnrc.yml) - Yarnrc configuration files (yarnrc.json)' is not valid:
/properties/httpTimeout/type : must be equal to one of the allowed values
/properties/httpTimeout/type : must be array
/properties/httpTimeout/type : must match a schema in anyOfYAML(768)

Resolves #6972

How did you fix it?

type could be omitted completely (it's redundant with oneOf) but is required by the Docusaurus configuration (via
https://github.com/arcanis/react-json-doc?), so I added it as an array.

To prevent further regressions, I added validation of the JSON Schemas using AJV. If there's a better place for this test to reside, please let me know.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

`"type": "mixed"` is not valid JSON Schema. This results in errors in
features such as VS Code's automatic validation:

```
Schema 'Yarn Config (.yarnrc.yml) - Yarnrc configuration files (yarnrc.json)' is not valid:
/properties/httpTimeout/type : must be equal to one of the allowed values
/properties/httpTimeout/type : must be array
/properties/httpTimeout/type : must match a schema in anyOfYAML(768)
```

`type` could be omitted completely (it's redundant with `oneOf`) but is
required by the Docusaurus configuration (via
https://github.com/arcanis/react-json-doc?).

To prevent further regressions, I added validation of the JSON Schemas
using [AJV](https://ajv.js.org/). If there's a better place for this
test to reside, please let me know.

Fixes yarnpkg#6972
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: JSON Schema errors in 4.11.0

1 participant