Giter Club home page Giter Club logo

phoenix_api_docs's People

Contributors

benmorganio avatar hodak avatar jtomaszewski avatar smoku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

phoenix_api_docs's Issues

Formatter cannot encode JSON because association is not loaded

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

problem configuring ExUnit

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

Add support for request headers

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.

Unable to define route without parameter

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)

Release 0.1.1?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.