InseeFrLab / onyxia

🔬 Data science environment for k8s
https://onyxia.sh
MIT License
458 stars 80 forks source link

enhance json schema support : array #802

Open fcomte opened 5 months ago

fcomte commented 5 months ago

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 commented 5 months ago

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 ignore "required" and "additionalProperties" for this first step (they are supposed to false in our imlementation at the moment