Open paulbalomiri opened 1 year ago
I have created this upstream PR to Openapi-generator
I might transform the changes, or do a complete rewrite of the generator into a custom generator for this project if the pain pressure gets too high, as i'm planning to use all apis from elixir in a self-deployed setup.
Awesome, thank you so much for your work @paulbalomiri :) Please let me know how it goes :)
I have some personal urgency until thursday. In the meantime i'll find out whether this will be a custom generator or i can formulate an upstream PR to openapi-generator. I think i'll know this week.
Preflight checklist
Bug Description
Generated Elixir module names such as
Ory.Connection
clash. Elixir dependencies cannot override each other's Modules, but the generated code does contain the same module name in different dependencies:Examples:
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/client/elixir/lib/ory/connection.ex#L5
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/hydra/elixir/lib/ory/connection.ex#L5
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/keto/elixir/lib/ory/connection.ex#L5
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/oathkeeper/elixir/lib/ory/connection.ex#L5
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/kratos/elixir/lib/ory/connection.ex#L5
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/client/elixir/lib/ory/connection.ex#L5 This is a follwup to this comment https://github.com/ory/sdk/issues/194#issuecomment-1318133766
Reproducing the bug
Create any library importing e.g. at least 2 packages: Example snippet from
mix.exs
:Relevant log output
when building/running lots of warnings such as this one is logged:
Relevant configuration
Here is the Variable setting, to which I propose to add this line:
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/scripts/prep.sh#L85 And here the line 3 should be changed to
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/config/client/elixir.yml#L1-L3
This results in package names such as
Ory.Hydra.Connection
Version
latest stable versions
Additional Context
@aeneasr I'm putting here the questions I have for understanding & documentation, These are mostly issues to get the PR right.
I'll come back with a PR on this, I've already forked the sdk. The bug is easy to solve, but perhaps a followup documentation issue would benefit from those questions.
It's a rather long post, so feel free to only discuss in context of the upcoming PR.