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

oneOf issue #1548

Open
sgurin opened this issue Sep 13, 2023 · 1 comment
Open

oneOf issue #1548

sgurin opened this issue Sep 13, 2023 · 1 comment

Comments

@sgurin
Copy link

sgurin commented Sep 13, 2023

Hi.

Take a look on the example https://sgurin.github.io/jsoneditor/examples/26_autocomplete_by_schema.html

When I am trying to set profession -> level there is only one option available

image

but schema contains 3 refs

  "profession": {
    "oneOf": [
      {
        "$ref": "junior"
      },
      {
        "$ref": "experienced"
      },
      {
        "$ref": "senior"
      },
    ]
  },

Looks like refs don't work

@josdejong
Copy link
Owner

josdejong commented Sep 13, 2023

Yes you are right, thanks for bringing this up. So to fix this, the code that creates the enum should proabably merge multiple enums in a case like oneOf. And maybe when there is a conflict and one of the options of oneOf does not contain an enum for that field, it should not create an enum.

Anyone interested in improving this?

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