Using generic named type in API Blueprint on Apiary.io

881 views Asked by At

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

1

There are 1 answers

1
Ladislav Prskavec On

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