swagger-express-middleware
swagger-express-middleware copied to clipboard
add example to JsonSchema, fix wrap for complicated wrap object
There is 2 fixes:
- add posibility to use example information in JsonSchema
- fix wrapping collection with complicating wrap object. For example:
swagger: '2.0'
info:
version: 0.1.0
title: Test
paths:
/items:
get:
responses:
200:
description: Success
schema:
properties:
status:
type: string
example: success
pagination:
$ref: '#/definitions/PAGINATION'
items:
type: array
items:
$ref: '#/definitions/ITEM'
definitions:
ITEM:
properties:
id:
type: integer
example: 12
name:
type: string
example: name
PAGINATION:
properties:
per_page:
type: integer
example: 15
current_page:
type: integer
example: 1
total_pages:
type: integer
example: 1
Properties pagination
and status
not exist in mock without that fix.
Awesome, thanks! I'll take a closer look at it this weekend or early next week and get it merged in.
Sorry, I haven't had a chance to take a look at this yet. I'm currently working on a refactoring of Swagger Parser, which will have upstream effects on Swagger Express Middleware, so I'm waiting for that refactoring to be done before I merge this Pull Request