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

Adding different display name to enum with ui-Schema #4215

Open
1 task done
perelin opened this issue Jun 11, 2024 · 1 comment
Open
1 task done

Adding different display name to enum with ui-Schema #4215

perelin opened this issue Jun 11, 2024 · 1 comment

Comments

@perelin
Copy link

perelin commented Jun 11, 2024

Prerequisites

What theme are you using?

core

What is your question?

We are auto-generating our base json-schema files directly from a (graphql) API schema. So enums there are not meant for human consumption and need labels.

We use ui-Schema to augment the generated json-schema files with all necessary presentation layer things (titles, order, etc). The only thing that we dont manage to do is give enums new labels.

How can we approach this?

@perelin perelin added needs triage Initial label given, to be assigned correct labels and assigned question labels Jun 11, 2024
@nickgros
Copy link
Contributor

I don't think you can do that today, the only ways to label an enum are using oneOf/title or the deprecated & nonstandard enumNames property in the JSON Schema (docs).

The reason we deprecated enumNames is because it's a nonstandard JSON Schema field. I think it could be useful to have a similar feature added to the uiSchema. We'd be happy to review a PR if you are interested in contributing this feature!

@nickgros nickgros added awaiting response uiSchema feature Is a feature request and removed needs triage Initial label given, to be assigned correct labels and assigned labels Jun 21, 2024
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