Skip to content

[csharp] Fix property names#13681

Merged
wing328 merged 8 commits intoOpenAPITools:masterfrom
devhl-labs:inherit-api2
May 28, 2023
Merged

[csharp] Fix property names#13681
wing328 merged 8 commits intoOpenAPITools:masterfrom
devhl-labs:inherit-api2

Conversation

@devhl-labs
Copy link
Contributor

@devhl-labs devhl-labs commented Oct 12, 2022

This small change fixes multiple issues.

-Underscored variables are usually for private fields. Its pretty unusual to use it for anything else
-Previously, only CodegenModel#vars was getting the property names corrected. That should be fine, but due to the various property collections containing different instances of CodegenProperties (another issue imho) it is not.
-Ensures that the property and the related model constructor parameter have the same name (see the image below). When they are different it can cause deserialization to fail.

image

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
    
    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*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.1.0) (minor release - 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.

@mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05)

@wing328
Copy link
Member

wing328 commented Oct 19, 2022

as discussed, this is a breaking change without fallback so we'll target 7.0.0 release instead.

@wing328
Copy link
Member

wing328 commented May 21, 2023

@devhl-labs can you please resolve the merge conflicts when you've time? Then we'll get it merged into 7.0.0 as it'a a breaking change without fallback.

@devhl-labs
Copy link
Contributor Author

Yes, will fix it soon.

@wing328
Copy link
Member

wing328 commented May 28, 2023

please resolve the merge conflicts then I'll merge this one first.

@wing328 wing328 merged commit 784c700 into OpenAPITools:master May 28, 2023
@devhl-labs devhl-labs deleted the inherit-api2 branch May 28, 2023 05:51
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.

2 participants