redhat-developer / redhat-developer/yaml-language-server
URL fragment references does not resolve correctly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Describe the bug
The URL fragments in schema URL feature does not work as expected. Take, for example, following YAML file referencing and Open API schema fragment.
# yaml-language-server: $schema=https://github.com/OAI/OpenAPI-Specification/raw/main/schemas/v3.1/schema.json#/$defs/parameter
name: token
in: header
description: token to be passed as a header
required: true
schema:
type: array
items:
type: integer
format: int64
style: simple
Here is a reference to the parameter object.
Instead of validation the object using the fragment, it validates it using the base object in the schema.
Expected Behavior
I would expect yamlls to resolve the fragment and use the objects' definition as its base for validation.
Steps to Reproduce
- Create a yaml file
- Paste the yaml above
- Watch
yamllsoutput
Environment
- Windows
- Mac
- Linux
- other (please specify)
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 reproducing the issue with the YAML example and trace the schema URL resolution path, since no source file or test is named in the report. Done means the #/$defs/parameter fragment is resolved and the YAML object is validated against that definition rather than the base schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100