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

How to reference an array field from an enum field? #4176

Open
1 task done
easyjoh opened this issue Apr 26, 2024 · 1 comment
Open
1 task done

How to reference an array field from an enum field? #4176

easyjoh opened this issue Apr 26, 2024 · 1 comment

Comments

@easyjoh
Copy link

easyjoh commented Apr 26, 2024

Prerequisites

What theme are you using?

material-ui

What is your question?

I am trying to collect an array of string items in one field.
In another field I need to point which of the items in the array shall be the default, thus, I want a dropdown with the items collected in field1.

I am trying something like this.

how do I get et working?

"secondlines": {
      "$id": "#/properties/secondlines",
      "type": "array",
      "format": "table",
      "uniqueItems": true,
      "title": "Secondlines",
      "default": [
        "Some string"
      ],
      "items": {
        "$id": "#/properties/secondlines/items",
        "type": "string"
      }
    },
    "defaultsecondline": {
      "$id": "#/properties/defaultsecondline",
      "type": "string",
      "title": "Default secondline"
      },
      "enum": [
        {
          "$data": "/secondlines"
        }
      ]
    }
@easyjoh easyjoh added needs triage Initial label given, to be assigned correct labels and assigned question labels Apr 26, 2024
@heath-freenome heath-freenome removed the needs triage Initial label given, to be assigned correct labels and assigned label May 17, 2024
@heath-freenome
Copy link
Member

@easyjoh Given what you are wanting, I am not sure that the JSON Schema specification even supports this. I would first research if what you want is even possible.

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

No branches or pull requests

2 participants