Skip to content

Inconsistent handling of 405 on version-neutral endpoints #159

Closed
@shreeena

Description

@shreeena

Using 1.1.0 on ASP.NET Core:

When requesting a version-neutral endpoint with an unsupported HTTP method, a 400 response is returned with the following body:

{
    "error": {
        "code": "ApiVersionUnspecified",
        "message": "An API version is required, but was not specified."
    }
}

On a versioned endpoint with an unsupported HTTP method, a 405 response is returned with the following body:

{
    "error": {
        "code": "UnsupportedApiVersion",
        "message": "The HTTP resource that matches the request URI '{requestUri}' does not support the API version '1.0'."
    }
}

In issue #65, it seems we have decided to use 405's over 400's. Could we keep version-neutral endpoints consistent with this? In addition, the response body is quite misleading.

As for the response body attached to the 405 -- could we make the message a little less misleading as well?

Thanks.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions