Skip to content

Titles in refs are not incorporated when constructing allOf/oneOf/anyOf dropdowns #2016

Closed
@erunion

Description

@erunion

Prerequisites

Description

If a title property is stored within a $ref on an allOf, oneOf, or anyOf schema, it is not used when constructing a dropdown select for that schema.

Steps to Reproduce

You can see this in action here: https://rjsf-team.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6e30sInNjaGVtYSI6eyJ0eXBlIjoib2JqZWN0Iiwib25lT2YiOlt7IiRyZWYiOiIjL2NvbXBvbmVudHMvc2NoZW1hcy9DYXQifSx7InRpdGxlIjoiV29vZiIsIiRyZWYiOiIjL2NvbXBvbmVudHMvc2NoZW1hcy9Eb2cifV0sImNvbXBvbmVudHMiOnsic2NoZW1hcyI6eyJQZXQiOnsidHlwZSI6Im9iamVjdCIsInJlcXVpcmVkIjpbInBldF90eXBlIl0sInByb3BlcnRpZXMiOnsicGV0X3R5cGUiOnsidHlwZSI6InN0cmluZyJ9fSwiZGlzY3JpbWluYXRvciI6eyJwcm9wZXJ0eU5hbWUiOiJwZXRfdHlwZSJ9fSwiRG9nIjp7ImFsbE9mIjpbeyIkcmVmIjoiIy9jb21wb25lbnRzL3NjaGVtYXMvUGV0In0seyJ0eXBlIjoib2JqZWN0IiwicHJvcGVydGllcyI6eyJiYXJrIjp7InR5cGUiOiJib29sZWFuIn0sImJyZWVkIjp7InR5cGUiOiJzdHJpbmciLCJlbnVtIjpbIkRpbmdvIiwiSHVza3kiLCJSZXRyaWV2ZXIiLCJTaGVwaGVyZCJdfX19XX0sIkNhdCI6eyJ0aXRsZSI6Ik1lb3ciLCJ0eXBlIjoib2JqZWN0IiwiYWxsT2YiOlt7IiRyZWYiOiIjL2NvbXBvbmVudHMvc2NoZW1hcy9QZXQifSx7InR5cGUiOiJvYmplY3QiLCJwcm9wZXJ0aWVzIjp7Imh1bnRzIjp7InR5cGUiOiJib29sZWFuIn0sImFnZSI6eyJ0eXBlIjoiaW50ZWdlciJ9fX1dfX19fSwidWlTY2hlbWEiOnt9LCJ0aGVtZSI6ImRlZmF1bHQiLCJsaXZlU2V0dGluZ3MiOnsidmFsaWRhdGUiOmZhbHNlLCJkaXNhYmxlIjpmYWxzZSwib21pdEV4dHJhRGF0YSI6ZmFsc2UsImxpdmVPbWl0IjpmYWxzZX19

We have a oneOf with both entries in the array being loaded via a $ref. One of them has a title alongside the $ref in the array, while the other has a title in the $ref schema. The one with the title alongside has its title represented in the dropdown, while the other has an option label of "Option 1".

Expected behavior

Titles within a $ref should be incorporated into the dropdown option labels.

Actual behavior

Title is not accessed within the $ref when constructing the dropdown.

Version

Current HEAD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions