yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

URL fragment references does not resolve correctly

Open michaelvanstraten opened this issue 1 year ago • 0 comments

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

  1. Create a yaml file
  2. Paste the yaml above
  3. Watch yamlls output

Environment

  • [ ] Windows
  • [x] Mac
  • [ ] Linux
  • [ ] other (please specify)

michaelvanstraten avatar Jan 30 '24 19:01 michaelvanstraten