Skip to content

Add support for titles #5717

@lcawl

Description

@lcawl

🚀 Feature Proposal

Add support for the title schema object property, in particular for schemas that are used in oneOf/anyOf/allOf scenarios.

IMO this is a relatively low priority because we're currently pruning the heavily nested objects (related to aggregations and query DSL etc). If we eventually include those details in the API documentation, however, we'll benefit from the ability to control the titles.

Motivation

In cases where there is an allOf, anyOf, or oneOf, the options are displayed in a tab.
In the absence of a title, the tab labels are based on the schema name or generated from the type.
By supporting an explicit title value, we can have more control over those labels.

Example

For example, in the "find API keys with a query" request body (https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-api-keys#operation-security-query-api-keys-body-application-json-sort), the tab labels are all generated:

Image

If we had a way to inject a title, the desired output would have a "title" property like this:

      "_types.Sort": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/_types.SortCombinations"
          },
          {
            "type": "array",
            "title": "my title", 
            "items": {
              "$ref": "#/components/schemas/_types.SortCombinations"
            }
          }
        ]
      },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions