Skip to content

Instantly share code, notes, and snippets.

@mokamoto
Created September 21, 2018 03:39
Show Gist options
  • Save mokamoto/9cea80c14a83c57362ee6ce7e0700d0e to your computer and use it in GitHub Desktop.
Save mokamoto/9cea80c14a83c57362ee6ce7e0700d0e to your computer and use it in GitHub Desktop.
MuleSoftハンズオン - RAML定義
#%RAML 1.0
title: DevRel-Quick Start Products API
version: v1.0
##securitySchemes:
## basic:
## description: |
## This API supports Basic Authentication.
## type: Basic Authentication
##securedBy: [basic]
types:
product:
properties:
identifier?: string
identifiers: IdentifierMap
brand: string
model: string
rating: number
description?: string
pictures: string[]
price: price
price:
properties:
amount: amount
salesUnit: salesUnit
amount:
properties:
currency: string
currencyValue: number
name : string
salesUnit:
properties:
code: string
name: string
Identifier:
type: string
pattern: ^[0-9A-Za-z-]+
minLength: 3
maxLength: 36
IdentifierMap:
type: array
items:
type: object
properties:
/[0-9A-Z-]+/:
type: Identifier
/products:
/{productId}:
uriParameters:
productId: string
get:
responses:
200:
body:
application/json:
type: product
example: |
{
"brand": "Anypoint",
"identifier": "eb8c8ca7-3c42-4489-a820-3aa138430b75",
"identifiers": [{
"SKU": "UGG-BB-PUR-06"
}],
"model": "Smart Slim Micro Stripe Shirt",
"rating": 5,
"description": "Shirt by ASOS Tall. Stripe woven fabric. Added stretch for comfort. Spread collar. Button placket. Slim fit - cut close to the body. Machine wash. 98% Cotton, 2% Elastane. Our model wears a size Medium Long and is 193cm/6'4\" tall",
"pictures": [
"https://launderkart.com/wp-content/uploads/2016/07/Shirt.jpg",
"https://cdni.llbean.net/is/image/wim/251423_47_41?wid=428&hei=494"
],
"price": {
"amount": {
"currency": "USD",
"currencyValue": 34.90,
"name": "Amount"
},
"salesUnit": {
"code": "EA",
"name": "Each"
}
}
}
404:
body:
application/json:
properties:
message: string
example: |
{
"message" : "Product not found"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment