Skip to content

yaml conversion does not resolve aliases correctly. #1075

@pjsk-stripe

Description

@pjsk-stripe

Describe the bug

Aliases are not resolved after a certain, seemingly arbitrary, point in a large yaml file. This does not appear to be a function of depth of aliases but rather of number of aliases in the file.

Expected Behavior

redhat.vscode-yaml VSCode extension can process aliases in a large yaml file equally across the entire file.

Current Behavior

Tested using redhad.vscode-yaml VSCode extension. A large file with N independent aliases will only resolve the properties with the first N entries.

Steps to Reproduce

This is a bit complicated, and sorry that it depends on the vscode extension.

  1. Install redhad.vscode-yaml in vscode.
  2. Create a large yaml file with a lot of objects including a known field (here's the one I used)
  3. Add a schema that ensures the field is required to yaml.schemas (in the above case, "name" is inherited from foo on all 2000 objects).
{
  "id": "foo-yaml-schema#",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Schema for a foo.yaml",
  "type": "object",
  "additionalProperties": {
    "$ref": "#/definitions/foo"
  },
  "definitions": {
    "foo": {
      "type": "object",
      "required": [":name"],
      "additionalProperties": false,
      "properties": {
        ":name": { "type": "string" }
      }
    }
  }
}
  1. View the file in vscode:
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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions