[REQ] Specify ExDoc dependency for Elixir
Created by: tobbbles
Is your feature request related to a problem? Please describe.
As discovered in https://github.com/ory/sdk/pull/189#issuecomment-1139425420, 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 https://github.com/OpenAPITools/openapi-generator/blob/0204bf4ae284d936e4f7cb1ffad314c04d5df9db/samples/client/petstore/elixir/lib/openapi_petstore/connection.ex#L6) 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.