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

global_spec must be server-bound #205

Open
elbrujohalcon opened this issue Oct 1, 2024 · 0 comments
Open

global_spec must be server-bound #205

elbrujohalcon opened this issue Oct 1, 2024 · 0 comments

Comments

@elbrujohalcon
Copy link
Member

I have two cowboy servers running different REST APIs in my Erlang VM.
To split their swagger pages I do…

        trails:trail(
            "/audit/rest/api-docs/swagger.json",
            cowboy_swagger_json_handler,
            #{server => server_one},
            #{get => #{hidden => true}}
        ),
…
        trails:store(server_one, Trails),

…in one, and…

        trails:trail(
            "/audit/rest/api-docs/swagger.json",
            cowboy_swagger_json_handler,
            #{server => server_two},
            #{get => #{hidden => true}}
        ),
…
        trails:store(server_two, Trails),

…in the other.
That works perfectly fine except for the global specs, because if I do…

cowboy_swagger:set_global_spec(TheSpec)

…or even if I use add_definition/1 directly, they end up both with the same tags and definitions and… well… basically the same spec, which (in my case) is incorrect.

I would like to have independent (per-server) specs, so that each one can have their own.

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

No branches or pull requests

1 participant