Skip to content

Fragment resolution from #512 doesn't always work #522

Closed
@mgabeler-lee-6rs

Description

@mgabeler-lee-6rs

Describe the bug

The work done by @evidolob in #512 doesn't seem to work for several folks, including myself and @remcohaszing:

Based on Remco's comment, it also seems to vary by the specific schema URL used.

Expected Behavior

The PR should allow validating files against a sub-set of an upstream URL based on a fragment identifier

Current Behavior

For some people it works, and for others it doesn't. It's unclear what the difference is, and how to debug this

Steps to Reproduce

  1. Create example.yaml as below
  2. Observe the errors -- it is validating against the JSON schema represented by the top level URL, instead of validating against the sub-schema identified by the fragment

example.yaml:

# yaml-language-server: $schema=https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json#/definitions/Schema
type: object

Errors I see:
image

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions