smoku / phoenix_api_docs Goto Github PK
View Code? Open in Web Editor NEWPhoenix API Docs
License: MIT License
Phoenix API Docs
License: MIT License
I get this error message, but I cannot deduce why it would even try to encode any model.
17:15:29.912 [error] GenEvent handler PhoenixApiDocs.Formatter installed in #PID<0.412.0> terminating
** (RuntimeError) cannot encode association :entries from Onemedical.Patient to JSON because the association was not loaded. Please make sure you have preloaded the association or remove it from the data to be en
coded
(ecto) lib/ecto/poison.ex:8: Poison.Encoder.Ecto.Association.NotLoaded.encode/2
(poison) lib/poison/encoder.ex:213: anonymous fn/4 in Poison.Encoder.Map.encode/3
(poison) lib/poison/encoder.ex:214: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3
(poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.encode/3
(poison) lib/poison/encoder.ex:213: anonymous fn/4 in Poison.Encoder.Map.encode/3
(poison) lib/poison/encoder.ex:214: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3
(poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.encode/3
(poison) lib/poison/encoder.ex:213: anonymous fn/4 in Poison.Encoder.Map.encode/3
(poison) lib/poison/encoder.ex:214: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3
(poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.encode/3
(poison) lib/poison.ex:41: Poison.encode!/2
(phoenix_api_docs) lib/phoenix_api_docs/generator.ex:64: PhoenixApiDocs.Generator.request_map/2
(phoenix_api_docs) lib/phoenix_api_docs/generator.ex:46: anonymous fn/3 in PhoenixApiDocs.Generator.requests/2
(elixir) lib/enum.ex:1623: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_api_docs) lib/phoenix_api_docs/generator.ex:26: PhoenixApiDocs.Generator.routes_docs/2
(phoenix_api_docs) lib/phoenix_api_docs/generator.ex:12: PhoenixApiDocs.Generator.run/0
(phoenix_api_docs) lib/phoenix_api_docs/formatter.ex:22: PhoenixApiDocs.Formatter.save_blueprint_file/0
(phoenix_api_docs) lib/phoenix_api_docs/formatter.ex:9: PhoenixApiDocs.Formatter.handle_event/2
(stdlib) gen_event.erl:533: :gen_event.server_update/4
(stdlib) gen_event.erl:515: :gen_event.server_notify/4
As indicated in the documentation, i put in the test_helper.exs this:
PhoenixApiDocs.start ExUnit.start(formatters: [ExUnit.CLIFormatter, PhoenixApiDocs.Formatter])
when i run mix test, the console show me this:
09:22:51.173 [error] GenEvent handler PhoenixApiDocs.Formatter installed in #PID<0.323.0> terminating ** (UndefinedFunctionError) function WhitespaceEx.Application.Router.__routes__/0 is undefined (module WhitespaceEx.Application.Router is not available) WhitespaceEx.Application.Router.__routes__() (phoenix_api_docs) lib/phoenix_api_docs/generator.ex:26: PhoenixApiDocs.Generator.routes_docs/2 (phoenix_api_docs) lib/phoenix_api_docs/generator.ex:12: PhoenixApiDocs.Generator.run/0 (phoenix_api_docs) lib/phoenix_api_docs/formatter.ex:22: PhoenixApiDocs.Formatter.save_blueprint_file/0 (phoenix_api_docs) lib/phoenix_api_docs/formatter.ex:9: PhoenixApiDocs.Formatter.handle_event/2 (stdlib) gen_event.erl:573: :gen_event.server_update/4 (stdlib) gen_event.erl:555: :gen_event.server_notify/4 (stdlib) gen_event.erl:296: :gen_event.handle_msg/6 (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3 Last message: {:suite_finished, 6679713, nil}
and the documentation in a file api.apib is not generate. The project configuration has erlang 19.2, elixir 1.4.2, Phoenix v1.2.4, nodejs 7.4.0, Erlang/OTP 20
In my app we strongly rely on headers (JWT authorization, pagination, etc.) and it would be great to have request and response headers values available in docs.
Some GET routes can have no request parameter, this tool fails in this case complaining:
no parameters specified, expected a nested list of parameters, one parameter per list item (warning code 3)
This looks great, but the API I'm building at the moment is almost entirely socket-based. Could this be extended to support that as well? (Or is there something similar for socket APIs?)
Hey @smoku,
Are you able to release a 0.1.1 for the fixes that were made and to ensure this guy aligns with Elixir 1.4?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.