Using a Typical Named Type in the Blueprint API on Apiary.io

How can I use the generic named type in my blueprint API 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 the palette editor gives me an error:

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

+4
source share
1 answer

here are two problems. The Decorator address is not a base type, such as an object and attributes that you must use Mixin or Attachment .

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
0
source

Source: https://habr.com/ru/post/1663218/


All Articles