0

In apiary this is saying object in the light colored text. enter image description here

This is not an object, its an array and I defined as such. I have tried a few ways to get the text to update as you can see from the code and image, but I have not been successful. Am I missing anything?

### List Order Coupons [GET /{order_id}/coupons{?page, limit}]

There are no filter parameter specific to coupons. 


+ Parameters
    + order_id (number, required)

        The order id

+ Response 200 (application/json)

    + Body

            [
              {
                "id": 1,
                "coupon_id": 1,
                "order_id": 115,
                "code": "557D2DEA0CCAFA1",
                "amount": "5.0000",
                "type": 1,
                "discount": "4.6600"
              }
            ]

    + Attributes (OrderCouponsResponse)

....(my definitions)

    ## OrderCouponsResponse (array)
    + (object) - (Tried to re organize after array did not work.)
        + `id` (number) - Numeric ID of the coupon code.
        + `coupon_id` (number) - Numeric ID of the associated coupon.
        + `order_id` (number) - Numeric ID of the associated order.
        + `code` (number) - Coupon code, as a string.
        + `amount` (number) - Amount of the coupon code.
        + type (enum)
            + `per_item_discount`
            + per_total_discount
            + shipping_discount
            + shipping_discount
            + percentage_discount
        + discount (number, optional) - The discount to apply to an order, as either an amount or a percentage.
T.J.
  • 415
  • 3
  • 17

1 Answers1

0

Note: I do work for Apiary Oracle

There is also a "0" character in the rendered interface. It is at the complete right position of the same row as the "Object" text. That zero character unfortunately represents a fact that the element is a zero-index-nth element of an Array. And that then the element is an Object (which is correct).

It is unfortunate and easily missed. The "zero" is not that visible, as it should be.

Jakub Koral
  • 368
  • 4
  • 10
  • Can you explain this answer a bit more. How can I have it show as an array and not an object? – T.J. May 01 '18 at 13:24
  • It's "Array of Objects". And Apiary Machine Column renders it that way. I tried to explain that the "0" (zero) character at the top-right corner of the box in the screenshot is saying "This is an Array" and then the "object" text says that the Array contains Object(s). – Jakub Koral May 02 '18 at 16:28