6

How can I use generic named type in my API Blueprint definition?

I try like this:

FORMAT: 1A HOST: http://test.com/

# API Blueprint testing.

## Resource [/resources]
### Action [GET]

+ Response 200 (application/json)

    + Attributes
        + decorated_person (Address Decorator(Person))


# Data Structures

## Person (object)
+ first_name
+ last_name

## Address Decorator (*T*)
+ address

But Apiary Editor give me the error:

base type 'Address Decorator(Person)' is not defined in the document

bovin.a
  • 123
  • 6

1 Answers1

0

here is two problems. Address Decorator isn't base type for example object and in attributes you have to use Mixin or Nesting.

FORMAT: 1A 

HOST: http://test.com/

# API Blueprint testing.

## Resource [/resources]
### Action [GET]

+ Response 200 (application/json)

    + Attributes
        + Include AddressDecorator


# Data Structures

## Person (object)
+ first_name
+ last_name

## AddressDecorator (object)
+ address
Ladislav Prskavec
  • 4,351
  • 3
  • 19
  • 16
  • Ladislav, thanks for answer, but I want to know how can I use generic named types in API Blueprint definition. Rather than how can I workaround it. – bovin.a Dec 13 '16 at 09:26