Skip to content

Conversation

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Aug 10, 2021

  • Use the same logic we have in RequestDelegateFactory.Create to
    determine if a method parameter is required or not. We then set the
    IsRequired property on the ApiParameterDesciption.
  • Added tests

Fixes #35081

TODO: Figure out why tests don't properly expose NRT metadata. It might be because of this bug dotnet/roslyn#55254

- Use the same logic we have in RequestDelegateFactory.Create to
determine if a method parameter is required or not. We then set the
IsRequired property on the ApiParameterDesciption.
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Aug 10, 2021
@davidfowl davidfowl requested a review from halter73 August 10, 2021 18:56
@davidfowl davidfowl added feature-minimal-actions Controller-like actions for endpoint routing old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Aug 10, 2021
@davidfowl davidfowl changed the title Set isRequired on ApiDescriptions for endpoints Set IsRequired on ApiDescriptions for endpoints Aug 10, 2021
@davidfowl davidfowl merged commit 123bd06 into main Aug 11, 2021
@davidfowl davidfowl deleted the davidfowl/is-required-minimal branch August 11, 2021 23:01
@ghost ghost added this to the 6.0-rc1 milestone Aug 11, 2021
@amcasey amcasey added the area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc label Jun 2, 2023
@danmoseley danmoseley removed the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-minimal-actions Controller-like actions for endpoint routing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set required parameter attribute in OpenAPI metadata

6 participants