Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rust): allow more granular Rust integer types and cleaned up clippy warnings #12479

Merged
merged 5 commits into from
Jul 9, 2022

Conversation

thrykol
Copy link
Contributor

@thrykol thrykol commented May 26, 2022

  • Added CLI option to down cast integers to their best fit
    • Will only occur when minimum and maximum are both set
    • Configuration defaults to false
  • Added CLI option to prefer unsigned integers
    • Will only occur when minimum is defined and non-negative
    • Configuration defaults to false
  • toParamName now lower cases to adhere to rustfmt
    • Previously, the tail component of $ref was being upper cased
  • Added unit tests around all new features

@frol
@farcaller
@richardwhiuk
@paladinzh

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 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
  • File the PR against the correct branch: master (6.0.1) (patch release), 6.1.x (breaking changes with fallbacks), 7.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.

@wing328
Copy link
Member

wing328 commented Jul 9, 2022

LGTM. Thanks for the enhancement.

@wing328 wing328 merged commit a1892b1 into OpenAPITools:master Jul 9, 2022
@spacether
Copy link
Contributor

Sample up to date test failed in CI for this PR

@spacether
Copy link
Contributor

I am fixing it in:
#12817

@@ -414,7 +456,8 @@ public String toVarName(String name) {

@Override
public String toParamName(String name) {
return toVarName(name);
// $ref appears to be all uppercase which is contrary to rustfmt practice so lowercase parameters
return toVarName(name.toLowerCase(Locale.ROOT));
Copy link
Member

@wing328 wing328 Jul 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #12820

@wing328
Copy link
Member

wing328 commented Jul 10, 2022

Thanks @spacether

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.

3 participants