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

generate swagger.json on build #169

Open
DmytroKostin0 opened this issue Dec 15, 2023 · 4 comments
Open

generate swagger.json on build #169

DmytroKostin0 opened this issue Dec 15, 2023 · 4 comments

Comments

@DmytroKostin0
Copy link

is there any way to generate swagger.json on build time?

@paulo-ferraz-oliveira
Copy link
Collaborator

Not at this moment, I don't think. It shouldn't be complex to implement, as a hook on cowboy_swagger:to_json/1, but I'm not sure we'll want that. @elbrujohalcon?

@elbrujohalcon
Copy link
Member

Yeah… I would say it should not be the default app behaviour. But, if it's clearly optional, we can accept a PR with such changes.

@paulo-ferraz-oliveira
Copy link
Collaborator

👍 then I propose a behaviour with a single function cowboy_swagger_json_exporter:export/1 where the input is the generated swagger.json. Then with an application config. key like e.g. json_exporter_mod, you can add a module name that'll be called when the JSON is done.

@elbrujohalcon
Copy link
Member

Sounds good to me

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

No branches or pull requests

3 participants