Skip to content

Conversation

janssen92
Copy link
Contributor

Since c# 8 / .net core 3.0 it is possible to add a nullable annotation to a project file.
This allows to use the ? annotation not only on non-nullable types but on all types.

Using this annotations can improve the readability within the code and also improves API behavior in regards to optional (nullable) properties.

The default behavior is not altered, it should stay compatible with everything.

Tests were added to ensure correct behavior.

This PR is a possible solution for:
#9190
#9022

@shibayan @Blackclaws @lucamazzanti

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, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@devhl-labs
Copy link
Contributor

My pr has this switch in the abstract.

#9235

@wing328
Copy link
Member

wing328 commented May 31, 2021

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@janssen92 janssen92 force-pushed the feature/aspnetcoreserver-add-nullable-annotation-support branch from f9a1e0b to adc3e53 Compare June 1, 2021 05:31
@janssen92
Copy link
Contributor Author

@wing328 Thanks, I updated the commit :)

@devhl-labs I adjusted my config/variable naming to be compatible with your PR #9235

@wing328
Copy link
Member

wing328 commented Jun 2, 2021

@devhl-labs thanks for reviewing and your work on #9235 to kick-start the work on nullable annotation support.

@janssen92 thanks for PR as well as the test.

Merging this one as it has tests to cover the change.

@wing328 wing328 merged commit b9e7595 into OpenAPITools:master Jun 2, 2021
@devhl-labs
Copy link
Contributor

devhl-labs commented Jun 2, 2021

Isnt the switch in the wrong file though? This is only for the asp net core geneeator, not the broader csharp language. This doesnt replace my pr.

@janssen92
Copy link
Contributor Author

@devhl-labs aggreed, i wanted to stay compatible to your PR. It can be moved to the abstract part at any time, so there shouldn't be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants