Open halostatue opened 2 years ago
Interesting find, I have no idea where this problem is coming from. Could it be a bug in the OpenAPI Generator itself?
If so, could you please raise an issue and/or fix with them and link the issue here? :)
I’ve been playing with openapi-generator for other issues. One of my fixes will be in 6.0.1, which will reduce the number of warnings generated from hundreds to one. The other which will eliminate that one will be in the next week or two—it is a more involved change.
I didn’t see any instructions on how to generate clients to test this, but this feels like (either) a configuration error or an OpenAPI specification error. If you have any instructions, I can try generating the code locally to see if the error persists. I also couldn’t quite figure out how the incorrect application specification showed up.
Thank you! You can test this out by cloning the repo, going into the project root, and follow: https://github.com/ory/sdk#debugging-failing-circleci-tests
Just as a note, I believe that this will be fixed with OpenAPITools/openapi-generator#12775.
Nice! We’ll be watching out for that one - thank you for the detailed issue!
Is the generator output already in this repo?
I'm a bit confused about the clients/client
directory vs clients/{hydra,kratos,...}
directories, the latter containing only service-specific code. All those packages redefine common modules such as Ory.Connection
, which makes it impossible to depend on more than one of the generated packages (ory_client
, ory_kratos
, ...)
@halostatue i'd like to know:
ory_client
dependency is the way to go?ory_apis
key, which should be the app's name (can still be different from the package name though):
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/client/elixir/config/config.exs#L10
https://github.com/ory/sdk/blob/2324e5c13c45d43c7e7b3cdc5ebc86b86b627867/clients/client/elixir/mix.exs#L5I'm trying to get my project to use hydra and kratos apis.
Thank you for the patch, it is much better now, as e.g. use auth for admin is settable on Ory.Connection
, previously i had to reimplement the calls for that.
Also I have a question regarding packaging & versioning:
I see that the hex package with version 0.2.0-alpha.60 is published on hex. if ory_client
is the way to go, is there a way to know which versions of kratos,hydra e.t.c were the base for the generated code?
Thanks for @halostatue, and of course to ory for your work!
I haven't looked at Ory since July, and I’m currently on vacation. The most recent version of openapi-generator should be reporting a few more details about what it was generated with from the OpenAPI file…but I don’t know about the current status of this.
Thanks, will fork and try to configure the generator to non-colliding package names. I'll open a separate ticket if that yields some success.
I'm thinking of changing invokerPackage
to a new variable Ory.${ELIXIR_CAMELIZED_PACKAGE_NAME}
here:
Happy Holydays @halostatue 🥳 !
Preflight checklist
Describe the bug
When compiling
clients/client/elixir
, the following message is printed:The documentation also refers to this:
However,
mix.exs
calls the application:ory_client
, which is the name that should be used in the configuration and examples.I haven’t played with the code generation process, so I am not sure where
:ory_apis
vs:ory_client
is coming from, but it is an issue.Reproducing the bug
Relevant log output
No response
Relevant configuration
No response
Version
n/a
On which operating system are you observing this issue?
No response
In which environment are you deploying?
No response
Additional Context
No response