I have created an API that delivers a resource named "Thumbnail" (/thumbnails)
{
"name": "toto",
"uri": "http://xxx"
}
In other hand I have multiple resources that includes that Thumbnail resource in them (like /articles, /videos ...):
{
"name": "playlist",
"thumbnail":
{
"name": "toto",
"uri": "http://xxx"
}
}
When I write the schemas of those webservices in the BluePrint markdown, I would like to be able to reuse the schema that I've created for the Thumbnail schema in order to not repeat the code in the schemas. I've heart of the Trait feature ( https://github.com/apiaryio/api-blueprint/issues/47 ) but I don't know if it will fit my needs and if it works with aglio and dredd.
Do you know the best thing to do in my case?
You can use MSON in Attributes section of the API Blueprint to define reusable objects.
You can see some examples in here, here and here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With