josdejong/jsoneditor

Schema enum dropdown not supported by $ref files.

Open

#1,044 创建于 2020年7月10日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (2,034 fork)batch import
featurehelp wanted

仓库指标

Star
 (10,781 star)
PR 合并指标
 (平均合并 15小时 36分钟) (30 天内合并 3 个 PR)

描述

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)

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.

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!

贡献者指南