FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Revise 405 Response Object description to follow the RFC7231 Specification 's definition by weimengxi · Pull Request #1486 · OAI/OpenAPI-Specification · GitHub

Revise 405 Response Object description to follow the RFC7231 Specification 's definition - #1486

Merged
MikeRalphson merged 1 commit into
OAI:v3.0.2-devfrom
weimengxi:v3.0.2-dev
Feb 13, 2018
Merged

Revise 405 Response Object description to follow the RFC7231 Specification 's definition#1486
MikeRalphson merged 1 commit into
OAI:v3.0.2-devfrom
weimengxi:v3.0.2-dev

Conversation

Copy link
Copy Markdown

As the document says, the key of a responses object's Patterned Fields is Http Status Code .

and the document gives responses object examples like this at following part.

  "responses": {
    "405": {
      "description": "Invalid input",
      "content": {
        "application/json": {},
        "application/xml": {}
      }
    }
  }

As it defined in rfc7231 Specification , 405 indicates Method Not Allowed rather than Invalid Input .

The 405 (Method Not Allowed) status code indicates that the method
received in the request-line is known by the origin server but not
supported by the target resource.

I think we'd better follow the rfc7231 Specification 's definition

#1449

weimengxi changed the title Revise 405 Response Object description to follow the rfc7231 Specification 's definition Revise 405 Response Object description to follow the RFC7231 Specification 's definition Feb 11, 2018

Copy link
Copy Markdown
Author

hi @MikeRalphson, sorry to disturb you again ~

Copy link
Copy Markdown
Member

Not at all, @weimengxi thank you for resubmitting. Looks good now. Just needs another reviewer to sign off.

webron commented Feb 12, 2018

Copy link
Copy Markdown
Member

@MikeRalphson here you go.

Copy link
Copy Markdown

Hi there, it seems that there is a underlying problem here: as responses ca only be defined for an operation (an accepted method on a specific path) defining a 405 "Method not allowed" response makes no sense, as you're just writing that you accept this method (by exposing it in the OAI Spec file)

IMHO the only place holder to define the 405 response would be at the path level, but that's a huge change.

MikeRalphson commented Oct 9, 2018
edited
Loading

Copy link
Copy Markdown
Member

What if the method is not allowed for some users, but is for others?

Copy link
Copy Markdown
Member

What @MikeRalphson said, and....

The allowed methods are dynamic over the lifetime of a resource. That's why OPTIONS returns an Allow header. Something that may be initially updatable, may at some time later be read-only. Also, paths are templated and therefore some resources under the path may support one set of methods and other resources may support a different set of methods.

Copy link
Copy Markdown

HI Mike, Darrel,

You're damn right! Sorry, working ATM on a product that must filter out what the backend sends back and validate that it cnforms to what's in the OAI Spec file and I was just wondering how you could specify a 405 for a method that is not authorized in any context...

All in all all what I've got to do is define only a 405 response for this method and voila.

Sorry again!

rstular added a commit to rstular/swagger-editor that referenced this pull request Dec 4, 2023
The petstore YAML is not consistent with the OpenAPI schema 3.0.2 and 3.0.3 as it uses HTTP response code 405 incorrectly (OAI/OpenAPI-Specification#1486)
rstular added a commit to rstular/swagger-editor that referenced this pull request Dec 22, 2023
The petstore YAML is not consistent with the OpenAPI schema 3.0.2 and 3.0.3 as it uses HTTP response code 405 incorrectly (OAI/OpenAPI-Specification#1486)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL