Open bark-mshort opened 2 years ago
I actually think it is the same problem as https://github.com/OpenAPITools/openapi-generator/issues/4690 but it's closed. It looks like when I require 'message'
in category_created_message
, it now has trouble finding message_all_of
. I'm not sure what the actual order needs to be for all classes to get loaded, but it seems to be that they are required in the module alphabetically. Autoloading the classes may fix that.
When you call openapi-generator generate
, can you try passing the new useAutoload
parameter as it's not the default? This should fix any require ordering issues.
My coworker @BARK-TWOFFORD has taken the reigns on this project so I will defer to him! I've sent him the issue to test out
@Fryguy, I had an uninitialized constant
issue as well, and setting useAutoload
with OPENAPI_GENERATOR_VERSION=6.1.0-SNAPSHOT
resolved it. ✅
Bug Report Checklist
Description
After importing the API spec for commercetools, the newly created ruby client is unable to load the class
Message
. An issue was initially opened with commercetools regarding the spec, but after being able to properly generate the client, we are still unable to properly initialize the client via both our rails application and the regular irb console.openapi-generator version
OpenAPI declaration file content or url
https://raw.githubusercontent.com/commercetools/commercetools-api-reference/main/oas/openapi.yaml
Generation Details
Install Generator
Create Ruby Client
Steps to reproduce
As defined by setup instructions in the automatically generated client, build the gem and install locally:
Load irb console and require gem:
Related issues/PRs
There is an open issue for adding support to autoload classes: https://github.com/OpenAPITools/openapi-generator/issues/12648
This kind of error is something I do typically encounter in our rails application whenever there is an issue with autoloading classes (specifically if the path does not match the class name), so it could possibly be related. It could also be this issue with inheritance, which does reference the above issue: https://github.com/OpenAPITools/openapi-generator/issues/4690. It's unclear to me if this is the same issue though.
Suggest a fix
Ultimately the client is unable to load the class
Message
, but not sure where specifically the code is breaking.