nishanthg92
Library to generate Api Docs in elixir
I am basically from symfony background, i am new to elixir. In symfony there is ApiDocBundle which allows me to generate a decent documentation for my APIs. Likewise is there any method in Phoenix Elixir ??
Most Liked
axelson
GitHub - 2fd/graphdoc: Static page generator for documenting GraphQL Schema · GitHub and GitHub - brettchalupa/graphql-docs: Easily generate beautiful documentation from your GraphQL schema. · GitHub are the two that crop up easiest from a Google search. I just investigated using graphdoc and it was pretty easy to setup, these are the basic steps:
npm install -g @2fd/graphdoc
mix absinthe.schema.json --schema MySchema --pretty path/to/schema.json
graphdoc -s path/to/schema.json -o doc/schema
Although instead of actually using absinthe.schema.json I grabbed the same schema that Graphiql downloads
bobbypriambodo
apiDoc supports Elixir comment syntax:
@apidoc """
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User
@apiParam {Number} id Users unique ID.
@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
"""
def get_user(conn, %{"id" => id} = params) do
# do something here
end
But you need Node.js to generate it:
$ npm install apidoc -g
$ apidoc -i lib/ -o doc/
mbuhot
I use phoenix_swagger to generate an API spec from the code, then use bureaucrat to merge example API request/responses with the swagger into markdown files. Compile the markdown to HTML with a static site generator and copy to the priv/static dir of the Phoenix app.
Now the app serves its own docs that are always up to date and have tested examples. There’s a swagger-ui for interactive requests.
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
- #javascript
- #code-sync
- #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








