Skip to content

MediaTypeApiVersionReaderBuilder Does Not Report Parameter Source #904

@commonsensesoftware

Description

@commonsensesoftware

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions