0

I have a requirement to design this spec using RAML:

Resource: quantity

Method: GET

URL: {orderId}/{itemId}/quantity

Objective is to pass orderId and itemId in the URI and get quantity. I am designing it this way:

/{orderId}/{itemId}/quantity:
  get:

Is it a best practice to design resource this way or there have a better way?

Helen
  • 87,344
  • 17
  • 243
  • 314
ray
  • 4,210
  • 8
  • 35
  • 46

1 Answers1

0

Something like this will be a bit more RESTful by providing the relationship between your orders and items as collections and individual data:

/orders:
  /{order_id}:
    /items:
      /{item_id}:
        get:

quantity should be a field in the response body.

George
  • 2,758
  • 12
  • 16