0

We are looking at using the API Blueprint. There are cases where we would like to get Response on the basis of Request. So, anyone know how we can do it in API Blueprint.

Sajal
  • 1
  • 2

1 Answers1

1

Yes, this is supported, see this article: Handling multiple actions on a single resource

You can write multiple Request(s) *and/or* Response(s). It is especially suitable for handling multiple types of Content-Type header.

  # Message [/messages/{id}]
  This resource represents one particular message identified by its *id*.

  ## Retrieve Message [GET]
  + Response 200 (application/json)

          {"message":"Hello World!"}

  + Response 200 (text/plain)

          Hello world!

  + Response 401 (text/plain)

          There is no such a message for you, dear guest.

  + Response 410

          The message you are searching for does not exist anymore.
JackuB
  • 36
  • 3