Handling multiple extensions for an endpoint


#1

I am trying to set up our API description and we have something where you can call the same endpoint with different extensions to get different items in return. I am wondering how to describe this using RAML 1.0. For example

GET /api/thing/someID.json

WIll return a json represenation of this thing.

GET /api/thing/someID.png

Will return a png image of this thing.

Is there a simple concise way to represent this, or do I have to make different endpoints for each file extension since they return different file types?


#2

I’d do it this way.

GET /api/thing/somejsons/{id}
GET /api/thing/somepngs/{id}