redhat-developer / redhat-developer/vscode-yaml
Use openAPIV3Schema from CustomResourceDefinition?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Is your enhancement related to a problem? Please describe.
Given that a lot of projects provide a CRD without a standalone schema, I would like to be able to use the CRD for validation in vscode:
# yaml-language-server: $schema=https://raw.githubusercontent.com/crossplane-contrib/provider-kubernetes/refs/heads/main/examples/in-composition/definition.yaml
There's a schema in the CRD:
spec.versions[].schema.openAPIV3Schema
Describe the solution you would like
Some way to validate using the openAPIV3Schema from a CustomResourceDefinition (CRD).
Describe alternatives you have considered
Extract the schema using tools such as
Or
Or manual extraction
spec:
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
# ... OpenAPI v3 schema definition ...
Additional context
Related to https://github.com/redhat-developer/yaml-language-server/issues/132 ?
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
Start by reviewing the existing schema validation and schema URL handling in the vscode-yaml extension, then examine the linked yaml-language-server issue. Determine how a CRD's spec.versions[].schema.openAPIV3Schema could be selected and used for validation. Done means a CRD such as the linked definition.yaml can provide validation without manual schema extraction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, typescript, yaml
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100