Skip to content
Switch branches/tags
Go to file
Wrap lines, it's more suited to a plaintext format like markdown.

For rendering, paragraphs don't _need_ to be wrapped. But markdown uses
a double-linebreak as paragraph separator so that paragraphs _can_ be
wrapped. As Gruber writes:

    Readability, however, is emphasized above all else. A
    Markdown-formatted document should be publishable as-is, as plain
    text, without looking like it’s been marked up with tags or
    formatting instructions.

For me, this includes wrapping lines. A lot of source code, such as
C or javascript, doesn't need wrapping either. But yet we do, for
readability and better diffs.

Here's a markdown style guide that raises the same points (both pro
and con):
4 contributors

Users who have contributed to this file

@pksunkara @kylef @telaviv1 @jean


Data Structures API

Following Advanced Attributes, this example demonstrates defining arbitrary data structure to be reused by various attribute descriptions.

Since a portion of the Coupon data structure is shared between the Coupon definition itself and the Create a Coupon action, it was separated into a Coupon Base data structure in the Data Structures API Blueprint Section. Doing so enables us to reuse it as a base-type of other attribute definitions.

API Blueprint

Group Coupons

Coupon [/coupons/{id}]

A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer.

  • Parameters

    • id (string)

      The ID of the desired coupon.

  • Attributes (Coupon Base)

    • id: 250FF (string, required)
    • created: 1415203908 (number) - Time stamp

Retrieve a Coupon [GET]

Retrieves the coupon with the given ID.

  • Response 200 (application/json)
    • Attributes (Coupon)

Coupons [/coupons{?limit}]

  • Attributes (array[Coupon])

List all Coupons [GET]

Returns a list of your coupons.

  • Parameters

    • limit (number, optional)

      A limit on the number of objects to be returned. Limit can range between 1 and 100 items.

      • Default: 10
  • Response 200 (application/json)

    • Attributes (Coupons)

Create a Coupon [POST]

Creates a new Coupon.

  • Attributes (Coupon Base)

  • Request (application/json)

  • Response 200 (application/json)

    • Attributes (Coupon)

Data Structures

Coupon Base (object)

  • percent_off: 25 (number)

    A positive integer between 1 and 100 that represents the discount the coupon will apply.

  • redeem_by (number) - Date after which the coupon can no longer be redeemed