Repository navigation
Fix ApiExplorer to include FromQuery(Name) prefix in parameter names #68344
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1624,7 +1624,7 @@ public void GetApiDescription_ParameterDescription_FromQueryEmployee() | |
| var description = Assert.Single(descriptions); | ||
| Assert.Single(description.ParameterDescriptions); | ||
|
|
||
| var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Name"); | ||
| var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "employee.Name"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if Are we prefixing this as well? And is it expected to be prefixed? Same question applies to In addition, let's make sure we have equivalent tests for both Mvc and minimal API, including tests directed for OpenAPI
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If no scenario here is applicable for minimal API (e.g, an analyzer warning is produced), feel free to skip the minimal API part here. |
||
| Assert.Same(BindingSource.Query, id.Source); | ||
| Assert.Equal(typeof(string), id.Type); | ||
|
Comment on lines
+1627
to
1629
|
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update this comment as well to reflect the updated condition.
And correct me if I'm wrong, I think
modelMetadata.ContainerType != nullis responsible for appending a property name, so it prevents appending parameter name. But then the other check can append a parameter name but if and only if explicitly given viaIModelNameProvider.