3

I'm documenting an API and I have 2 responses very similar.

One of them is the call /resource/{id}. This response returns a resource model.

The other call is /resource/search{?name,category} which returns a list of resources so I need to return an array of the resource model.

I can't find if I can do this. On the blueprint documentation there is something similar about Gists. But there are two models Gist and Gist Collection.

I hope I explained my self.

Steve Tauber
  • 9,551
  • 5
  • 42
  • 46
Germán Lena
  • 867
  • 1
  • 6
  • 15

1 Answers1

1

Unfortunately at this moment you cannot reference one payload from another. The reason for this is that a payload (model, request or response) is opaque to the API Blueprint parser (and therefore you do not have to escape anything within).

There are plans to address this need and make blueprints more DRY in the future - See the Embedded Assets and Traits milestones.

Zdenek
  • 3,653
  • 27
  • 34