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

setSchema does not work #1422

Closed
qqsea opened this issue Feb 16, 2022 · 4 comments
Closed

setSchema does not work #1422

qqsea opened this issue Feb 16, 2022 · 4 comments
Labels

Comments

@qqsea
Copy link

qqsea commented Feb 16, 2022

Hi,
I want to dynamic update schema, and use setSchema api which seems not work.
Here is the example: I dynamic insert another enum string 'test' into gender field. the error message show the newly added value 'test', but there is no such 'test' option within drop down.

Thank you very much!

image

@josdejong
Copy link
Owner

@qqsea thanks for reporting. Can you share a minimal example demonstrating the issue? Like in https://jsbin.com or https://codesandbox.io or so?

@qqsea
Copy link
Author

qqsea commented Mar 2, 2022

Just based on the example from \examples\07_json_schema_validation.html.
Here is the code piece I added at the end of js script:

setTimeout(function(){
  var s = JSON.parse(JSON.stringify(schema))
  s.properties.gender.enum.push('test');
  editor.setSchema(s, {"job": JSON.parse(JSON.stringify(job))});
  editor.refresh();
}, 1000);

@josdejong
Copy link
Owner

Thanks, I'm able to reproduce this issue 👍

@josdejong josdejong added the bug label Mar 4, 2022
@josdejong josdejong changed the title setschema not work setschema does not work Mar 4, 2022
@josdejong josdejong changed the title setschema does not work setSchema does not work Mar 4, 2022
@josdejong
Copy link
Owner

This is fixed now in v9.7.3

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

No branches or pull requests

2 participants