WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#41735 new enhancement

Include titles for JSON Schema properties

Reported by: TimothyBlynJacobs Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch
Focuses: rest-api Cc:
PR Number:

Description

JSON Schema supports a title property that can hold a user-readable label for the property. This would be incredibly helpful in building generated documentation and user interfaces.

Attachments (1)

41735.diff (40.7 KB) - added by TimothyBlynJacobs 2 years ago.

Download all attachments as: .zip

Change History (4)

#1 @TimothyBlynJacobs
2 years ago

  • Keywords has-patch added

#2 @schlessera
2 years ago

I agree, this would be very useful for automated UI generation and documentation.

However, without something like #41305, it will also double the already exorbitant number of calls to translate(). Something to keep in mind before merging, as it will probably have a big negative impact on performance with the current codebase.

#3 @joehoyle
2 years ago

Interesting, perhaps we just missed this in the initial JSON schema pass! Seems like a good addition for UIs and the like, though as @schlessera we should probably do some testing around this. I imagine we might need to do a fresh pass to as we may have new properties too.

Note: See TracTickets for help on using tickets.