Enhancement: Support Swagger
Is your feature request related to a problem? Please describe. FastAPI supports OpenAPI as builtin. Is it possible to support OpenAPI to describe detail spec for another client which want to create, read, update, delete?
Describe the solution you'd like support API endpoint with OpenAPI description such as FastAPI does.
Describe alternatives you've considered
Additional context
Hello @code4rain, I'm not sure if I understood your request correctly, Do you mean some kind of ApiView to support CRUD on models via REST API?
Hello @jowilf
Please refer below. https://fastapi.tiangolo.com/features/#automatic-docs
Is it possible to show the rest api style(json style return) by starlette-admin?
Currrently starlette-admin generate rest api which return HTML(jinja2 based) instead of simple json style data.
- Only I found the json style return by list api with skip and limit. I can not find create, edit, delete for it.
Thanks for your reply 😊
Hello @code4rain,
Only the listing page follow OpenApi specification to serve datatables through RestAPI, the others endpoint use POST (multipart/form-data) request and they can't follow OpenAPI Specification due to some limitations with the way dynamic list and embedded document are handle with html and Javascript.
Take a look at this. You can see how the browser make the POST request with dynamic list (eg. array.1 array.2 array.3)
@jowilf Thank for explain. I will check the code as you mentioned.
@code4rain check my edited answer. I'm not sure it was clear
@jowilf Actually, I'm using FastAPI as backend for my service and communicated with FE engineer by OpenAPI (Swagger). FE engineer does not know about internal implementation of backend. And currently, I used starlette-admin for internal admin page and make new router to communicated with FE engineer to describe the models which backend handle.
I made this issue to prevent to make new router code if possible. :)
Sounds like a good idea, I'll reopen the issue and take a look at it when I have some free time to spend on it.
Is there any improvement on this one? FastAPI depends on Pydantic to generate the OpenAPI Schema. Supporting this feature would probably make Pydantic a requirement.