groig
Is there a better way to generate OpenAPI schemas for Phoenix REST APIs?
Hey everyone,
In Django, we have tools like drf-spectacular that can automatically generate OpenAPI schemas from serializers without extra work. I’m wondering if there’s something similar for Phoenix?
Right now, I’m using open_api_spex, but it feels a bit tedious to manually declare the request and response schemas for each endpoint, even if the paths get picked up automatically. Is there a better workflow or library for this in the Phoenix ecosystem? Or do people usually just accept the manual declarations as part of the process?
Any tips or experiences would be appreciated!
Most Liked
zachdaniel
The pattern we use could be applied to non JSON:API APIs as well, but we don’t focus on that with ash_json_api too much. But with generic actions you can write any API endpoint shape you want.
krasenyp
I still believe it’s better to generate the code from the schema instead of the opposite.
lud
Yes but not from a JSV schema directly. If you want to use an OpenAPI spec from a file you should follow this guide.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









