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

enhance json schema support : array #802

Open
fcomte opened this issue Apr 28, 2024 · 1 comment
Open

enhance json schema support : array #802

fcomte opened this issue Apr 28, 2024 · 1 comment
Assignees
Milestone

Comments

@fcomte
Copy link
Contributor

fcomte commented Apr 28, 2024

We should support array :
Items is the specification of one element in the list..

This helm chart implements this schema :

        "extraEnvVars": {
            "type": "array",
            "title": "Array of Environment Variables",
            "description": "A list of environment variables, where each variable includes a name and a value.",
            "default:": [
               {
                 "name": "My name",
                 "value": "My value"
               }
            ],
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the environment variable."
                },
                "value": {
                  "type": "string",
                  "description": "The value of the environment variable."
                }
              },
              "required": ["name", "value"],
              "additionalProperties": false
            }
        },
@fcomte
Copy link
Contributor Author

fcomte commented Apr 29, 2024

If items is not set we can keep our actual implementation with [] inside a textArea.

If items is set we can show the default value (if exist) inside the UI component that match the item ( as all type of field have their representation ). If there is no default there is two choices :

  • we can provide an empty object ( no need to click on a + button to add one object to the list ). But If you do this we can't know if the sent object should be : extraEnvVars : [ ] or extraEnvVars : [ { name: "", value: "" } ]
  • provide nothing and let user click on a + button can add this semantic.
    I prefer the first for the UX but the second for a generic approach.

We can ignore "required" and "additionalProperties" for this first step (they are supposed to false in our imlementation at the moment

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