2016-12-08 8 views
3

APIのBlueprint定義でgeneric named typeを使用するにはどうすればよいですか?Apiary.ioのAPI Blueprintで汎用名型を使用する

私はこのようにしてみてください:

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 

しかし、養蜂場エディタは私にエラーを与える:ここ

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

答えて

0

には2つの問題があります。アドレスデコレータはオブジェクトの基本型ではなく、属性にはMixinまたは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 
+0

私はAPI Blueprint定義で汎用名付きの型を使用する方法を知りたいと思いますが、回答していただきありがとうございます。それを回避するにはどうすればいいですか? –

関連する問題