Created
June 6, 2016 14:13
-
-
Save christianklotz/24b8c5caea19cbd84ab7b37adad054af to your computer and use it in GitHub Desktop.
Swagger spec for https://github.com/go-openapi/spec/issues/3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "Swagger Sample", | |
"description": "Sample API Playground.", | |
"version": "1.0.0" | |
}, | |
"basePath": "/v1", | |
"schemes": [ | |
"http" | |
], | |
"consumes": [ | |
"application/vdn.sample.v1+json" | |
], | |
"produces": [ | |
"application/vdn.sample.v1+json" | |
], | |
"paths": { | |
"/books": { | |
"get": { | |
"summary": "List all books", | |
"operationId": "listBooks", | |
"tags": [ | |
"books" | |
], | |
"responses": { | |
"200": { | |
"headers": { | |
"Link": { | |
"type": "string" | |
} | |
}, | |
"description": "An array of books", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Book" | |
} | |
} | |
}, | |
"default": { | |
"description": "generic error response", | |
"schema": { | |
"$ref": "#/definitions/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { | |
"Store": { | |
"type": "object", | |
"properties": { | |
"title": { | |
"type": "string", | |
"example": "Book Shop" | |
}, | |
"categories": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Category" | |
} | |
} | |
} | |
}, | |
"Category": { | |
"type": "object", | |
"properties": { | |
"title": { | |
"type": "string", | |
"example": "Drama" | |
}, | |
"books": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Book" | |
} | |
} | |
} | |
}, | |
"Book": { | |
"type": "object", | |
"required": [ | |
"title", | |
"summary" | |
], | |
"properties": { | |
"title": { | |
"type": "string", | |
"example": "Winnie the Pooh" | |
}, | |
"summary": { | |
"type": "string", | |
"example": "Famous children's book" | |
}, | |
"related_books": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Book" | |
} | |
} | |
} | |
}, | |
"Error": { | |
"type": "object", | |
"readOnly": true, | |
"properties": { | |
"code": { | |
"type": "integer", | |
"format": "int64", | |
"example": 400 | |
}, | |
"message": { | |
"type": "string", | |
"example": "Unexpected error" | |
} | |
}, | |
"required": [ | |
"message" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment