Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Use fastapi response_model for API documentation

Open croumegous opened this issue 2 years ago • 1 comments
trafficstars

We should use the feature provided by FastAPI to validate and document our API response: https://fastapi.tiangolo.com/tutorial/response-model/

Currently the openapi documentation doesn't have any documentation on the API output. Using response_model will fix that.

I'll work on this issue soon.

croumegous avatar Jan 01 '23 09:01 croumegous

Very good point, please assign yourself to this issue if you start working on it. Please note that some of the endpoint models are still a bit "volatile" at the moment. We definitely need a bit cleaner structuring of the web-facing request/response models + documentation for them. But laying the groundwork for this would be helpful and we could follow that pattern for changes and new models.

andreaskoepf avatar Jan 01 '23 11:01 andreaskoepf