redhat-developer / redhat-developer/yaml-language-server
openapi discriminators
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
I am 90% sure discriminators such as the below are openapi dialect, so not sure if yaml language server is supposed to support this schema definition.
"typebase": {
"type": "object",
"discriminator": {
"propertyName": "discriminator",
"mapping": {
"type1": "#/definitions/type1",
"type2": "#/definitions/type2"
}
},
"x-abstract": true,
"additionalProperties": false,
"required": [
"code",
"discriminator"
],
"properties": {
"code": {
"type": "string"
},
"discriminator": {
"type": "string"
}
}
},
Will I need to replace with if-then constructs to get the properties changing based on discriminator value? This stuff is confusing for me so maybe I made some other mistake!
Edit: can work with allOf and if-then, but with support for jsonschema <=7 can't use "unevaluatedProperties": false to restrict additional properties 🤔
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no implementation files, tests, or entry points. Start by identifying how the YAML language server handles JSON Schema and OpenAPI validation, then determine the intended discriminator behavior and compatibility constraints; done would require a decided support approach and corresponding validation behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100