Skip to content

UnsupportedApiVersion error when giving some different content type #744

Closed
@PranjaliSoni

Description

@PranjaliSoni

We are using 4.1.1 version of APiVersioning and 3.1 version of Asp.NetCore
I have a controller with an action which accepts only Content-Type "application/merge-patch+json"

[HttpPatch("{id}")]
[Consumes("application/merge-patch+json")]
public async Task<Object> CreateObjectAsync(
..
)
{
..
..
}

So while quering for the given api with content type "application/merge-patch+json".. It works fine
but quering for some other valid content type for example "application/json" gives 400 bad request and
following output:

{
    "error": {
        "code": "UnsupportedApiVersion",
        "message": "The HTTP resource that matches the request URI 'https://bb-df-wus2-1.farmbeats-dogfood.azure.net/farmers/pra88888m?api-version=2021-03-31-preview' does not support the API version '2021-03-31-preview'."
    }
}

and on using APiVersioning version as "5.0.0"
I got the same response with different status code.
Can you please help me with this?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions