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

Using itemProperties directive does not allow configuration of required item fields #94

Open
Persi opened this issue Oct 15, 2024 · 1 comment

Comments

@Persi
Copy link

Persi commented Oct 15, 2024

Currently using the following config:

myProp: [] # @schema description: cool prop ; uniqueItems:true ; item:object ; itemProperties:{"prop1": {"type": "string"}, "prop2": {"type": "string"}}

results in the following schema:

    "myProp": {
      "description": "cool prop",
      "items": {
        "properties": {
          "prop1": {
            "type": "string"
          },
          "prop2": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array",
      "uniqueItems": true
    },

This schema does not define required fields of the item elements.
It would be helpful if there would be a directive to define the required item fields which would result in a schema like that:

    "myProp": {
      "description": "cool prop",
      "items": {
        "properties": {
          "prop1": {
            "type": "string"
          },
          "prop2": {
            "type": "string"
          },
        },
        "type": "object",
        "required": ["prop1", "prop2"]
      },
      "type": "array",
      "uniqueItems": true
    },
@losisin
Copy link
Owner

losisin commented Oct 15, 2024

for now, required works as boolean and key is declared in yaml. I'll think about it if that behaviour should be changed
https://github.com/losisin/helm-values-schema-json/tree/main/docs#required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants