Skip to content

Required list not working as expected when using arrays or with properties using $ref #131

@kriberg

Description

@kriberg

I'm getting some unexpected behavior with values.yaml like this:

# @schema
# type: object
# required: true
# @schema
noArray:
  # @schema
  # type: string
  # required: true
  # @schema
  one:
  # @schema
  # type: string
  # required: true
  # @schema
  two:
# @schema
# type: object
# required: ["three", "four"]
# @schema
withArray:
  # @schema
  # type: string
  # required: true
  # @schema
  three:
  # @schema
  # type: string
  # required: false
  # @schema
  four:
# @schema
# type: object
# required: true
# @schema
noArrayWithRef:
  # @schema
  # $ref: https://something.com
  # type: string
  # required: true
  # @schema
  five:
  # @schema
  # type: string
  # required: true
  # @schema
  six:

The noArray object gets added to the top-level required list and with both sub-keys in it's own required list, like intended.

The withArray object gets omitted from the top-level required list, but both sub-keys are in it's required list.

The noArraywithRef object gets added to the top-level required, but the sub-key five with $ref: and required: true isn't added to it's required list.

My assumption would be that the top-level required list would have all three keys and then each of the objects would have both sub-keys as required. I've attached the generated values.schema.json for good measure

values.schema.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions