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

Dynamically updating editor schema #1500

Open
KodzghlyCZ opened this issue Feb 26, 2024 · 1 comment
Open

Dynamically updating editor schema #1500

KodzghlyCZ opened this issue Feb 26, 2024 · 1 comment

Comments

@KodzghlyCZ
Copy link

General information

  • json-editor version: latest

I need to dynamically update the schema of my editor, enum content to be precise. I have a configuration page where I need to select from list of files that constantly changes and I get the list of the files from API as a JSON list. I haven't found any way to dynamically add any value inside the enum while the editor is loaded.

{
  "title": "json schema example",
  "type": "object",
  "properties": {
    "string": {
      "type": "string",
      "description": "This is an example schema.",
      "enum": "[]" <----- Here I need to add some values after the editor is loaded.
    }
  }
}
@KodzghlyCZ KodzghlyCZ changed the title How to dynamically update editor schema Dynamically updating editor schema Feb 26, 2024
@tmeers
Copy link

tmeers commented Feb 29, 2024

I think what you want is the DescribedBy editor for this. I'm currently also looking at doing this same thing, though details on its implementation are a little lacking. Also the demo is broken as of #1316.

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