josdejong / josdejong/jsoneditor

Schema enum dropdown not supported by $ref files.

Open
#1,044 1 comment 0 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
JavaScript
Stars
12.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

Great library, big fan. Just dropping a quick note concerning the rendering of the dropdown menu for validation using the supplied JSON schema. I've got it happily working with programatic additions to the main JSON schema but have found a small discrepancy in how the render handles external $ref files. Pictures speak clearer so I'll demonstrate:

VLAN enum working fine when placed directly within the main schema object. (main object validates on test2 | test3)
Screen Shot 2020-07-10 at 2 45 48 PM

VLAN enum in external object definitions, passed through schemaRefs. Can see it is still validating (external definitions.json set to test4 | test5 to distinguish), however no longer rendering a dropdown, which allows user to supply random input.
Screen Shot 2020-07-10 at 2 46 16 PM

I'm luckily able to go about using monolithic JSON schemas if needed, so I can weigh my need of input restriction vs code reuse, but thought this would be good to point out, and would be great to get cleaned up and unified across behaviors. Cheers!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.