4

How do we document a message based API in Swagger or RAML ? By message based I mean that the endpoint is always the same, but one can send multiple message types to this endpoint and depending on the type of input message we get different responses. Is there an example of this type of API I can have look ?

Thank you. Luis Oscar

Luis Trigueiros
  • 636
  • 7
  • 21
  • 1
    OpenAPI/Swagger does not support RPC-style APIs. The corresponding proposals are [#664](https://github.com/OAI/OpenAPI-Specification/issues/664) and [#801](https://github.com/OAI/OpenAPI-Specification/issues/801). – Helen Apr 20 '17 at 11:41

1 Answers1

5

Swagger and OAS is especially used to document REST-like APIs. After a long search I have found the AsyncAPI specification. This can be used to document your message driven APIs.

There´s also an online editor available and if you are already familiar with using swagger, yaml it is easy to get started with this specification

Jehof
  • 34,674
  • 10
  • 123
  • 155