Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Within schema, fragments annotated with @schema/type any=True are erroneously validated as schema (rather than as a default value) #523

Closed
pivotaljohn opened this issue Oct 26, 2021 · 1 comment
Assignees
Labels
bug This issue describes a defect or unexpected behavior

Comments

@pivotaljohn
Copy link
Contributor

pivotaljohn commented Oct 26, 2021

(Inspired by #515)

What steps did you take:

#@data/values-schema
---
spec:
  #@schema/type any=True
  additionalConfig:
    args:
    - "cmd"
    - "arg1"

What happened:

Got this error:

ytt: Error:
Invalid schema
==============

Invalid schema - wrong number of items in array definition
==========================================================

schema.yml:
    |
  6 |     args:
    |

    = found: 2 array items
    = expected: exactly 1 array item, of the desired type
    = hint: in schema, the one item of the array implies the type of its elements.
    = hint: in schema, the default value for an array is always an empty list.
    = hint: default values can be overridden via a data values overlay.

What did you expect:
That anything within a YAML fragment that's annotated with @schema/type any=True:

  • can contain any valid YAML
  • is the default value for the annotated node.

Anything else you would like to add:
This expectation was implied, but made explicit with #516.

From an implementation perspective, this might well be "simply" to:

  1. stop processing this subtree of the schema AST for types ;
  2. consider this subtree as the default for the annotated node.

Environment:

  • ytt version (use ytt --version): v0.37.0

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@pivotaljohn pivotaljohn added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been triaged for relevance labels Oct 26, 2021
@pivotaljohn pivotaljohn removed the carvel triage This issue has not yet been triaged for relevance label Nov 1, 2021
@cari-lynn
Copy link
Contributor

Available in v0.38.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior
Projects
None yet
Development

No branches or pull requests

3 participants