Skip to content

Conversation

@ross-paypay
Copy link
Contributor

Fixes an issue when there are 2 models with the same name but different capitalization for Rust clients.
Partially fixes, #21078

The implementation is a simplified version of what the KotlinClientCodegen is doing

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

cc: @frol @farcaller @richardwhiuk @paladinzh @jacob-pro

@wing328
Copy link
Member

wing328 commented Apr 25, 2025

@ross-paypay ross-paypay force-pushed the fix-rust-model-filename-codegen branch from cc9d92d to a82635d Compare April 25, 2025 12:35
@ross-paypay
Copy link
Contributor Author

oops, sorry about that. I thought I update updated them but I guess not.
I pushed another commit with the updated samples.

@wing328 wing328 added this to the 7.13.0 milestone Apr 26, 2025
@wing328 wing328 merged commit 1c62f83 into OpenAPITools:master Apr 26, 2025
19 checks passed
@wing328
Copy link
Member

wing328 commented Apr 26, 2025

No problem. Thanks for the contributions as always.

Have a nice weekend

@gcatanese
Copy link
Contributor

@ross-paypay @wing328 the PR has introduced files with the same case-insensitive names. Can this be corrected?

warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'samples/client/petstore/rust/hyper/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/hyper/petstore/docs/Duplicatetest.md'
  'samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/hyper0x/petstore/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest-trait/petstore/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-async/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore/docs/Duplicatetest.md'

@ranger-ross
Copy link
Contributor

@gcatanese Can you provide steps to reproduce?
I can't seem to reproduce on my machine (I am on Fedora Linux btw)

@wing328
Copy link
Member

wing328 commented May 11, 2025

@ross-paypay I'm using a Window box and I'm able to repeat the issue with git bash

$ git clone https://github.com/OpenAPITools/openapi-generator openapi-generator4
Cloning into 'openapi-generator4'...
remote: Enumerating objects: 2097785, done.
remote: Counting objects: 100% (254/254), done.
remote: Compressing objects: 100% (185/185), done.
remote: Total 2097785 (delta 136), reused 63 (delta 63), pack-reused 2097531 (from 3)
Receiving objects: 100% (2097785/2097785), 895.94 MiB | 13.10 MiB/s, done.
Resolving deltas: 100% (1332178/1332178), done.
Updating files: 100% (57315/57315), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'samples/client/petstore/rust/hyper/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/hyper/petstore/docs/Duplicatetest.md'
  'samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/hyper0x/petstore/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-async/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Duplicatetest.md'
  'samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateTest.md'
  'samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicatetest.md'
  'samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateTest.md'
  'samples/client/petstore/rust/reqwest-trait/petstore/docs/Duplicatetest.md'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants