API / Swagger Interview questions
List the HTTP methods supported in OpenAPI operations?
OpenAPI supports describing operations for all the standard HTTP methods a REST API might use under a given path, each represented as its own key nested under that path in the specification.
| Method | Typical Use |
| get | Retrieve a resource or collection without side effects |
| post | Create a new resource, or trigger a non-idempotent action |
| put | Replace an existing resource entirely |
| patch | Partially update an existing resource |
| delete | Remove a resource |
| head | Retrieve headers only, no response body |
| options | Describe communication options for a resource |
| trace | Perform a diagnostic loop-back test (rarely used in practice) |
A single path can define operations for multiple methods at once — for example, /users/{id} commonly has both a get operation to retrieve a user and a delete operation to remove one, each documented with its own parameters and responses under the same path entry.
More Related questions...