Do you know that OpenAPI (formerly "Swagger") and REST are two different things?
- A "pure" REST API should be self-descriptive (i.e., it doesn't require any documentation) by implementing the HATEOAS (Hypermedia as the Engine of Application State) principle. Clients interact with the API entirely through URLs provided by the server, without needing to know the structure of URLs in advance. This is similar to how browsers follow links.
- Most REST APIs today are not "pure". Clients still need documentation to use the API's endpoints effectively.
OpenAPI helps describe (or document) "impure REST APIs." But please don't confuse the two! OpenAPI doesn't enforce as many conventions as REST. For example:
| REST (or impure REST)