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

Open API servers field & swagger basePath filed #134

Closed
DDDHuang opened this issue Jul 6, 2021 · 0 comments · Fixed by #135
Closed

Open API servers field & swagger basePath filed #134

DDDHuang opened this issue Jul 6, 2021 · 0 comments · Fixed by #135

Comments

@DDDHuang
Copy link
Collaborator

DDDHuang commented Jul 6, 2021

Use GlobalSpec like

GlobalSpec = #{
        swagger => "2.0",
        info => #{title => "EMQ X API", version => "5.0.0"},
        basePath => "/v5/api"
}

or

GlobalSpec = #{
        openapi => "3.0.0",
        info => #{title => "EMQ X API", version => "5.0.0"},
        servers => [#{url => "http://localhost:8081/v5/api"}]
}

and trails as

trails() ->
    Metadata = #{get => #{any => any}},
    [{"/v5/api/my_api", Metadata}].

In swagger, execute will like

curl -X GET "http://localhost:8081/api/v5/api/v5/my_api"

The "/api/v5/api/v5" is double.
Path should trans to without basePath or url def in GlobalSpec.

PR is in coming.

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

Successfully merging a pull request may close this issue.

1 participant