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

"title" in jsonschema vs "ui:title" in uischema #957

Closed
Eric24 opened this issue Jun 19, 2018 · 4 comments
Closed

"title" in jsonschema vs "ui:title" in uischema #957

Eric24 opened this issue Jun 19, 2018 · 4 comments

Comments

@Eric24
Copy link

Eric24 commented Jun 19, 2018

Which of these props is preferred? "ui:title" seems like the best option, since the field title/label is purely cosmetic (i.e. it does not affect the schema). But "ui:title" doesn't seem to work across the board. For example, it has no effect for array or boolean types ("title" in the jsonschema works fine for both).

There are also examples that have both "title" and "ui:title" defined. Is there any reason for this or are these examples "in transition"?

@epicfaace
Copy link
Member

It's also strange because

title is preferred over ui:title for ObjectFieldTemplate

ui:title is preferred over title for ArrayField and SchemaField

We need to harmonize this behavior to at least make it consistent.

@Eric24
Copy link
Author

Eric24 commented May 25, 2019

Just a few thoughts on this:

  • While "title" is defined as a valid JSON Schema keyword (https://json-schema.org/understanding-json-schema/reference/generic.html), my interpretation is that it's meant to describe the schema, combined with "description", not necessarily something that should be displayed in a UI.
  • In order to separate the data from the presentation layer, "ui:title" seems like a more appropriate way to express the title of a field in a UI.
  • For i18n, the "title" in the schema may be in one language (native to the developer, for example), while there may be multiple UI schemas with different "ui:title" languages, based on the UI user's preference.
  • For backward compatibility, perhaps "ui:title" should be the standard, with fallback to "title" if "ui:title" isn't defined.

PS - I would also suggest that the same could be said for "ui:description" with fallback to "description".

@C-odes
Copy link

C-odes commented Aug 20, 2019

PLEASE YES. It's weird, title has no effect sometimes and its not even showing even with the title in jsonschema. Only label is shown. Gona open an issue on this.

@heath-freenome
Copy link
Member

In v5 ui:title and ui:description over title and description were standardized. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants