Skip to content
Advertisement

FastAPI Textarea OpenAPI for Form Data

I am using Form Data format for APIs. The thing is how I am going to make OpenAPI input being larger by using textarea?

image

Advertisement

Answer

i’ve hacked.

my way is when specific field name, change input(type=text) to textarea. first,
you serve self-hosting javascript and css for docs. https://fastapi.tiangolo.com/advanced/extending-openapi/#self-hosting-javascript-and-css-for-docs.

second,
you change javascript source code like this.

JavaScript

you can hack css for more pretty but not need it for me. enjoy.

enter image description here

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement