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

[REQ] Specify ExDoc dependency for Elixir #12484

Closed
tobbbles opened this issue May 27, 2022 · 1 comment
Closed

[REQ] Specify ExDoc dependency for Elixir #12484

tobbbles opened this issue May 27, 2022 · 1 comment

Comments

@tobbbles
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As discovered in ory/sdk#189 (comment), there is a use case when using OpenAPI to generate a package with the intention to publish to https://hex.pm, and publishing documentation to https://hexdocs.pm - openapi-generator graciously generates moduledocs and function documents (as seen in the sample

) but if we user wishes to publish this generated package, the ex_docs dependency is missing.

Describe the solution you'd like

This is open to interpretation, but I see two ways to solve this.

The first being just adding ex_doc as a default dependency to the deps list, so all packages are generated with ex_doc as a dependency. The pros being this is a one-line change, the cons being every generated package may have a non-needed dependency if they aren't publishing documentation.

The more involved alternative is to expose a way to add additional dependencies via the configuration, so that deps can be dynamically configured, with the added benefit of consumers able to update dependencies without specifying their own template, or waiting for changes to land upstream.

Describe alternatives you've considered

As mentioned, we could just provide our own mix.exs.mustache template, but the downsides are quite large, with missing out upstream changes to the template, and introducing brittleness when upgrading openapi-generator, the developer(s) must also update their template if there have been any changes.

Additional context

Mentioned above, with adding Elixir client support to Ory's SDKs.

@wing328
Copy link
Member

wing328 commented May 29, 2022

Thanks for the suggestions.

The first being just adding ex_doc as a default dependency to the deps list, so all packages are generated with ex_doc as a dependency. The pros being this is a one-line change, the cons being every generated package may have a non-needed dependency if they aren't publishing documentation.

I suggested we go with this approach to start with. Users can always customize the template to remove the dependencies that they don't need.

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

2 participants