Open jnicholls opened 1 year ago
Tagging @jacob-pro here. Jacob, you introduced and iterated a bit on the AbstractRustCodegen
implementation, so thought you might have some insights here as well as a possible workaround (other than generating an inline name map of all the models, which did cross my mind...)
Bug Report Checklist
Description
I am working with the Microsoft Graph API specification (although I used
yq -o=json eval openapi.yaml > openapi.json
to convert to a JSON spec first, since there are too many Yaml code points for swagger-parser in v6.5.0 of openapi-generator). It has models named in the following format:microsoft.graph.user
microsoft.graph.authenticationMethod
microsoft.graph.fido2AuthenticationMethod
etc. The Rust client generator is outputting the following warnings:
This output is perplexing, as
MicrosoftGraphFido2AuthenticationMethod
post-sanitizing is completely legitimate for Rust, but it still performs another pass and addsPeriod
in placements where.
is in the original model name.Likewise, the module file pathing
microsoft/graph/fido2_authentication_method
would be perfectly legitimate (assuming proper supportingmod.rs
files were generated along the path) as a module path and file name. Or if not thatmicrosoft_graph_fido2_authentication_method
would be perfectly good as well, without the added_period
separator in the module path name.I realize these may be two separate issues, but since
Period
and_period
are likely rooted with the same failing to handle.
delimited model names, I bet they can be solved together.openapi-generator version
6.5.0
OpenAPI declaration file content or url
https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/openapi/v1.0/openapi.yaml
converted to json with:
Generation Details
Steps to reproduce
Suggest a fix
I briefly reviewed the AbstractRustCodegen class and how its calling down into DefaultCodegen for various name sanitizing and character replacement, but didn't dig very deep. I feel like the owner of AbstractRustCodegen will know of a good way to handle this issue immediately after reading this description.