forked from OAI/OpenAPI-Specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OAI#114 from fehguy/master
added support for models and parameters in `#/definitions` section
- Loading branch information
Showing
3 changed files
with
212 additions
and
85 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"swagger": 2.0, | ||
"info": { | ||
"version": "1.0.9-abcd", | ||
"title": "Swagger Sample API", | ||
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", | ||
"termsOfService": "http://helloreverb.com/terms/", | ||
"contact": { | ||
"name": "wordnik api team", | ||
"url": "http://developer.wordnik.com" | ||
}, | ||
"license": { | ||
"name": "Creative Commons 4.0 International", | ||
"url": "http://creativecommons.org/licenses/by/4.0/" | ||
} | ||
}, | ||
"host": "my.api.com", | ||
"basePath": "/v1", | ||
"schemes": [ | ||
"http", | ||
"https" | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json", | ||
"application/xml" | ||
], | ||
"paths": { | ||
"/pets/{id}": { | ||
"get": { | ||
"description": "Returns pets based on ID", | ||
"summary": "Find pets by ID", | ||
"operationId": "getPetsById", | ||
"parameters": [ | ||
{ "$ref": "#/parameters/skipParam" }, | ||
{ "$ref": "#/parameters/limitParam" } | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "pet response", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "Pet" | ||
} | ||
} | ||
}, | ||
"default": { | ||
"description": "error payload", | ||
"schema": { | ||
"$ref": "ErrorModel" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"skipParam": { | ||
"name": "skip", | ||
"in": "query", | ||
"description": "number of items to skip", | ||
"required": true, | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"limitParam": { | ||
"name": "limit", | ||
"in": "query", | ||
"description": "max records to return", | ||
"required": true, | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
}, | ||
"definitions": { | ||
"Pet": { | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"ErrorModel": { | ||
"required": [ "code", "message" ], | ||
"properties": { | ||
"code": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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