fern icon indicating copy to clipboard operation
fern copied to clipboard

[Feature] Allow overriding the `title` field of a type

Open mstade opened this issue 1 year ago • 2 comments

Problem description

Currently you can use the docs field in a Fern type to set the description field in the generated OpenAPI spec, however there's no way to set the title field of the generated schema. Instead, it defaults to be the same as the type name.

Why would it be useful?

Being able to specify the title of a type adds another level of human readable documentation, in addition to the very useful docs field.

Describe the solution (optional)

I propose adding title as a field for any type, and that it follows the same semantics as the title field in the relevant JSON Schema spec, that is:

6.1. "title" and "description" The value of both of these keywords MUST be a string. Both of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferrably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.

Additional context

n/a

mstade avatar Feb 13 '24 01:02 mstade

@mstade, we recently pushed a feature that will allow you to add display-name to every single type. This will be eventually plumbed through in the documentation, do you mind giving that a try ?

dsinghvi avatar Sep 14 '24 13:09 dsinghvi

Will do and report back – thank you @dsinghvi!

mstade avatar Sep 14 '24 13:09 mstade