Skip to content

Automatically add title and description to generated schema #212

Answered by wyfo
alexvoronov asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a way to add "title" and "description" attributes to the generated schema based on e.g. field name?

There are multiple ways, but they are not easy and documented.

GUI toolkits like https://github.com/rjsf-team/react-jsonschema-form and https://jsonforms.io/ require "title" attribute to render the form.

That's indeed an issue.

Pydantic even generates "title" based on the field name if title is not specified explicitly.

I did want to be as opinionated as Pydantic, and because I had no answer to the question "Should properties' title be capitalized or not?", I've preferred to not add title at all. But I should have given a way to do it easily.

I wonder if it is possible to au…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@alexvoronov
Comment options

@wyfo
Comment options

@alexvoronov
Comment options

Answer selected by alexvoronov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants