rjsf-team/react-jsonschema-form

Stop using type names and keywords as property names in examples

Closed

#2.403 geöffnet am 26. Mai 2021

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (2.136 Forks)batch import
featurehelp wanted

Repository-Metriken

Stars
 (13.175 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 3T 17h) (32 gemergte PRs in 30 T)

Beschreibung

Prerequisites

Description

Many of the examples in the playground are confusing and hard to read because of the terribly chosen property names. I would deeplink to each of the playground pages if I knew how.

  • The first example is Simple, where a property name is boolean. This makes it look like a data type goes there, rather than the property name.

  • The second example is Widgets, where different ways to display a boolean choice, are configured under the property name boolean. This is completely non sensical and almost seems aimed at confusing the reader.

  • The third example is the naming of conditional of one of the properties under Schema Dependencies. This makes the reader think conditional is a key word.

New or returning users looking to the playground for quick examples are unnecessarily frustrated this way.

Proposal:

  • Never use field types as a literal name for a property in an example.
  • Don't name properties after the kind of example they're being used in such as conditional. Use property names that resemble the fictional data points in the example (such as credit card or pet name), so that the reader understands it's just an example name and not a keyword.

Contributor Guide