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

use in phoenix compile error #14

Open
AndwareSsj opened this issue Jan 20, 2017 · 2 comments
Open

use in phoenix compile error #14

AndwareSsj opened this issue Jan 20, 2017 · 2 comments
Labels

Comments

@AndwareSsj
Copy link

error stack:

== Compilation error on file web/views/layout_view.ex ==
** (CompileError) web/views/layout_view.ex:2: module PhoenixMaru.Router.Helpers is not loaded and could not be found
    (phoenix_maru) expanding macro: PhoenixMaru.Web.__using__/1
    web/views/layout_view.ex:2: PhoenixMaru.LayoutView (module)
    (elixir) expanding macro: Kernel.use/2
    web/views/layout_view.ex:2: PhoenixMaru.LayoutView (module)
    (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

this is my code

defmodule PhoenixMaru.Api.Router do
  use Maru.Router, make_plug: true
  use MaruSwagger

  swagger at:         "/swagger",      # (required) the mount point for the URL
            pretty:     true,            # (optional) the environments swagger works
            except:     [:prod],         # (optional) the environments swagger NOT works
            force_json: true           # (optional) force JSON for all params instead of formData

  get do
    text conn, "API works!"
  end

  mount PhoenixMaru.Api.UserApi
end

I remove swagger config and make it. it's successfully. but use swagger config failed

@falood falood added the bug label Jan 23, 2017
@falood
Copy link
Member

falood commented Jan 23, 2017

Hi @AndwareSsj
That's a compile time bug.
Before I fix it and release new version, you can use such code to make your code works.

  swagger at: "/swagger",
            pretty: true,
            except: [:prod],
            force_json: true,
            swagger_inject: [basePath: "/"]

Thank you for using maru and pointing it out!

@AndwareSsj
Copy link
Author

@falood thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants