Using generic named type in API Blueprint on Apiary.io
Asked Answered
S

1

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

Subsist answered 8/12, 2016 at 10:45 Comment(0)
B
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
Bloomery answered 8/12, 2016 at 10:58 Comment(1)
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.Subsist

© 2022 - 2024 — McMap. All rights reserved.