Skip to content

Add format and title data to schema fields #1144

@redjen8

Description

@redjen8

Is your feature request related to a problem?

The format and tile are missing from the field data in the request/response schema.
Title data can function as an additional information (optimal), but I think the problem of not displaying type when there is format data can cause confusion for viewers.

    HoneyBee:
      title: bee
      description: A representation of a honey bee
      allOf:
        - $ref: "#/components/schemas/Pet"
        - type: object
          properties:
            honeyPerDay:
              title: honeyPerDay
              type: number
              description: Average amount of honey produced per day in ounces
              example: 3.14
              multipleOf: .01
              format: double
          required:
            - honeyPerDay
Image

Describe the solution you'd like

Display type + format data, title data if it exists as following screenshot

Image
if (schema.title) {
    if (schema.format) {
      return `${schema.title} (${schema.type}<${schema.format}>)`;
    }
    return `${schema.title} (${schema.type})`;
  }
  return schema.format ? `${schema.type}<${schema.format}>` : schema.type;

Describe alternatives you've considered

If it seems unnecessary to display title data, please consider just using format data in combination with type data.

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions