Swagger is a powerful open source framework backed by a large ecosystem of tools that helps you design, build, document, and consume your RESTful APIs.
'ab'.should.be.equalOneOf('a', 10, 'ab');
res.should.be.json();
promise.should.be.Promise();
['user_1', 'user_1000'].should.matchAny(/^(user_)+[1-9]{1}\d*$/);
request(app)
.get('/users/user_10')
.set('Accept', 'application/json')
.expect(200)
.then(response => {
response.should.be.json();
assert(response.body.name, 'hak')
})
request(app)
.get('/users/123')
.set('Accept', 'application/json')
.expect(400)
GET /users/{user_id}
swagger: '2.0'
info:
version: 1.0.0
title: Echo
description: |
#### Echos back every URL, method, parameter and header
Feel free to make a path or
an operation and use **Try Operation** to test it.
The echo server will render back everything.
schemes:
- http
host: mazimi-prod.apigee.net
basePath: /echo
paths:
/:
get:
responses:
200:
description: Echo GET
post:
responses:
200:
description: Echo POST
parameters:
- name: name
in: formData
description: name
type: string
- name: year
in: formData
description: year
type: string
---
- Lil Dicky
- Rae sremmurd
- R.City
---
[Lil Dicky, Rae sremmurd, R.City]
---
name: Lil Dicky
birth: 1988
born: United States
---
{name: Lil Dicky, birth: 1988, born: United States}
---
intro: Yeah bitch, check my profile. Perfect, but you are not.
profile:
name: beenzino
birth: 1987
sns:
youtube: https://www.youtube.com/channel/UCyFkumV0dfLxSY602sIYNvw
insta: https://www.instagram.com/realisshoman/
song:
single: [Nike Shoes, Aqua Man, Up All Night]
crew: [연결고리, '11:11']
indent : space 사용
name: hak
age: 27
programmer: true
money:
blog: http://sanghaklee.tistory.com/
lang:
- JavaScript
- PHP
- Java
{
"name": "hak",
"age": 27,
"programmer": true,
"money": null,
"blog": "http://sanghaklee.tistory.com/",
"lang": ["JavaScript", "PHP", "Java"]
}