Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #12484
Closed
Open
Issue created May 27, 2022 by Administrator@rootContributor

[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.

Assignee
Assign to
Time tracking