Skip to content

MediaTypeApiVersionReaderBuilder Does Not Report Parameter Source #904

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

Closed
1 task done
commonsensesoftware opened this issue Nov 11, 2022 · 0 comments · Fixed by #905
Closed
1 task done

MediaTypeApiVersionReaderBuilder Does Not Report Parameter Source #904

commonsensesoftware opened this issue Nov 11, 2022 · 0 comments · Fixed by #905
Assignees
Labels

Comments

@commonsensesoftware
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

MediaTypeApiVersionReaderBuilder implements IApiVersionParameterSource which is used to describe where an API version parameter can appear. The current implementation does not report its source correctly if there are no parameter names defined.

Expected Behavior

MediaTypeApiVersionReaderBuilder.AddParameters should indicate that it versions by media type, even when there are no parameters. This would have parity with UrlSegmentApiVersionReader, which also does not have parameters.

Steps To Reproduce

var reader = new MediaTypeApiVersionReaderBuilder().Build();
Assert.True(reader.VersionsByMediaType(), "Reader does not version by media type");

This fails when it should succeed.

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

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

Successfully merging a pull request may close this issue.

1 participant