java对象数组覆盖_java – 如何覆盖RAML 1.0中的对象数组属性类型
據(jù)了解,Response是抽象不同類型的數(shù)據(jù),但格式相似.一種方法是使用resourcesTypes抽象出響應(yīng)中的相似性,并在類型中定義具體的數(shù)據(jù).
#%RAML 1.0
title: New API
version: v1
baseUri: http://api.samplehost.com
mediaType: application/json
types:
User:
usage: A user in the system
properties:
firstname:
required: true
lastname:
required: true
ArticleId:
usage: An id of any article in the system
type: number
Article:
usage: Pattern for any article in the system
properties:
id:
type: ArticleId
required: true
created:
type: date
required: true
#######################################
# the following captures the similarity:
#######################################
resourceTypes:
collection:
get:
responses:
200:
body:
properties:
data: <>[]
###############
# API:
###############
/user:
description: All the users
type:
collection:
typename: User
/article:
description: All the articles
type:
collection:
typename: Article
總結(jié)
以上是生活随笔為你收集整理的java对象数组覆盖_java – 如何覆盖RAML 1.0中的对象数组属性类型的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
 
                            
                        - 上一篇: java中完成md5加密解密_java实
- 下一篇: python 拓扑排序_拓扑排序(top
