Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PhoenixSwagger #31

Merged
merged 3 commits into from
May 19, 2018
Merged

Add PhoenixSwagger #31

merged 3 commits into from
May 19, 2018

Conversation

indocomsoft
Copy link
Member

No description provided.

@indocomsoft indocomsoft requested a review from evansb May 14, 2018 03:02
@indocomsoft indocomsoft added this to the Sprint 1 milestone May 14, 2018
@indocomsoft indocomsoft added this to To do in Sprint 1 via automation May 14, 2018
@indocomsoft indocomsoft moved this from To do to Under Review in Sprint 1 May 14, 2018
@coveralls
Copy link

coveralls commented May 14, 2018

Pull Request Test Coverage Report for Build 111

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 96.273%

Totals Coverage Status
Change from base Build 109: 0.1%
Covered Lines: 155
Relevant Lines: 161

💛 - Coveralls

@indocomsoft
Copy link
Member Author

@evansb I'm not sure how to test the swagger part since they are just "metadata" there.

@evansb
Copy link
Contributor

evansb commented May 18, 2018

Create a test that simply use the function and does nothing, add a comment saying it's because swagger

@indocomsoft
Copy link
Member Author

Done.

Also a note to @sreycodes, swagger_path is a macro. The most relevant part from the source code is first line of this macro definition:

defmacro swagger_path(action, [do: {:__block__, _, [first_expr | exprs]}]) do
      fun_name = "swagger_path_#{action}" |> String.to_atom
      body = Enum.reduce(exprs, first_expr, fn expr, acc ->
              quote do unquote(acc) |> unquote(expr) end
             end)

      quote do
        def unquote(fun_name)(route) do

So basically the macro creates another function with the name swagger_path_create when we do swagger_path :create do for example.

@indocomsoft indocomsoft merged commit fb577ba into master May 19, 2018
Sprint 1 automation moved this from Under Review to Done May 19, 2018
@indocomsoft indocomsoft deleted the autogenerate-swagger branch May 19, 2018 08:28
@indocomsoft indocomsoft mentioned this pull request May 26, 2018
28 tasks
indocomsoft added a commit that referenced this pull request Aug 17, 2018
* Add PhoenixSwagger

* Add example swagger path and definition

* Add swagger tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Sprint 1
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants