{{keyName}}
diff --git a/src/main/template/main.handlebars b/src/main/template/main.handlebars
index ea898bc8..c9773692 100644
--- a/src/main/template/main.handlebars
+++ b/src/main/template/main.handlebars
@@ -1,9 +1,11 @@
{{#if info}}
{{info.title}}
-
{{{info.description}}}
- {{#if info.termsOfService}}
{{/if}}
- {{#if info.contact}}
{{/if}}
+
{{{info.description}}}
+ {{#if info.termsOfServiceUrl}}
{{/if}}
+ {{#if info.contact.name}}
Created by {{info.contact.name}}
{{/if}}
+ {{#if info.contact.url}}
{{/if}}
+ {{#if info.contact.email}}
{{/if}}
{{#if info.license}}
{{/if}}
{{/if}}
diff --git a/src/main/template/operation.handlebars b/src/main/template/operation.handlebars
index b7fa11a4..c17a7cb8 100644
--- a/src/main/template/operation.handlebars
+++ b/src/main/template/operation.handlebars
@@ -22,7 +22,7 @@
{{/if}}
{{#if description}}
Implementation Notes
-
{{{description}}}
+
{{{description}}}
{{/if}}
{{#oauth}}
@@ -41,7 +41,7 @@
{{/oauth}}
{{#if type}}
-
Response Class
+
Response Class (Status {{successCode}})
diff --git a/src/main/template/param.handlebars b/src/main/template/param.handlebars
index 95a5b425..8d3f6731 100644
--- a/src/main/template/param.handlebars
+++ b/src/main/template/param.handlebars
@@ -8,6 +8,8 @@
{{else}}
{{#if default}}
+
+
{{else}}
@@ -28,7 +30,7 @@
{{/if}}
-
{{{description}}} |
+
{{{description}}} |
{{{paramType}}} |
diff --git a/src/main/template/param_list.handlebars b/src/main/template/param_list.handlebars
index bffb03c7..015c1eaa 100644
--- a/src/main/template/param_list.handlebars
+++ b/src/main/template/param_list.handlebars
@@ -20,6 +20,6 @@
{{/each}}
|
-
{{{description}}} |
+
{{{description}}} |
{{{paramType}}} |
|
\ No newline at end of file
diff --git a/src/main/template/param_readonly.handlebars b/src/main/template/param_readonly.handlebars
index 7abbb7f5..bc961974 100644
--- a/src/main/template/param_readonly.handlebars
+++ b/src/main/template/param_readonly.handlebars
@@ -10,6 +10,6 @@
{{/if}}
{{/if}}
-
{{{description}}} |
+
{{{description}}} |
{{{paramType}}} |
|
diff --git a/src/main/template/param_readonly_required.handlebars b/src/main/template/param_readonly_required.handlebars
index ffa156ff..091ee4d6 100644
--- a/src/main/template/param_readonly_required.handlebars
+++ b/src/main/template/param_readonly_required.handlebars
@@ -10,6 +10,6 @@
{{/if}}
{{/if}}
-
{{{description}}} |
+
{{{description}}} |
{{{paramType}}} |
|
diff --git a/src/main/template/param_required.handlebars b/src/main/template/param_required.handlebars
index b543d096..d98a537a 100644
--- a/src/main/template/param_required.handlebars
+++ b/src/main/template/param_required.handlebars
@@ -6,6 +6,8 @@
{{else}}
{{#if default}}
+
+
{{else}}
@@ -25,7 +27,7 @@
{{/if}}
- {{{description}}}
+ {{{description}}}
|
{{{paramType}}} |
|
diff --git a/src/test/spec.html b/src/test/spec.html
deleted file mode 100644
index 6ced497a..00000000
--- a/src/test/spec.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
swagger-ui specs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/test/swagger-ui-spec.coffee b/src/test/swagger-ui-spec.coffee
deleted file mode 100644
index e9079a73..00000000
--- a/src/test/swagger-ui-spec.coffee
+++ /dev/null
@@ -1,49 +0,0 @@
-window.url = "http://api.wordnik.com/v4/resources.json"
-
-describe 'SwaggerUi', ->
-
- describe 'constructor', ->
-
- beforeEach ->
- window.ui = new SwaggerUi
- api_key: window.api_key
- url: window.url
- waitsFor ->
- ui.ready
-
- it "sets a `ready` property when the API is ready", ->
- runs ->
- expect(ui.ready).toBe(true)
-
- it "has access to the precompiled Handlebars template", ->
- runs ->
- expect(Handlebars.templates['template.html']).toBeDefined()
-
- describe 'DOM container', ->
-
- afterEach ->
- $("#swagger_ui").remove()
-
- it "renders to default DOM container if it exists", ->
- window.ui = new SwaggerUi
- waitsFor ->
- ui.ready
- runs ->
- expect($("#swagger_ui").length).toBe(1)
-
- it "creates default DOM container if it doesn't exist", ->
- expect($("#swagger_ui").length).toBe(0)
- window.ui = new SwaggerUi
- waitsFor ->
- ui.ready
- runs ->
- expect($("#swagger_ui").length).toBe(1)
-
- it "allows an alternate DOM container to be specified when initialized", ->
- expect($("#swagger_ui").length).toBe(0)
- window.ui = new SwaggerUi
- dom_id: 'zhwagger'
- waitsFor ->
- ui.ready
- runs ->
- expect($("#zhwagger").length).toBe(1)
\ No newline at end of file
diff --git a/swagger-ui.json b/swagger-ui.json
deleted file mode 100644
index b7ddb4df..00000000
--- a/swagger-ui.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "folders":
- [
- {
- "path": ".",
- "folder_exclude_patterns": ["dist", "node_modules", "lib"]
- }
- ],
- "settings":
- {
- "file_exclude_patterns": ["swagger-ui.sublime-workspace"]
- },
- "build_systems":
- [
- {
- "name": "List",
- "cmd": ["ls"]
- }
- ]
-}
diff --git a/test/e2e/v1.js b/test/e2e/v1.js
new file mode 100644
index 00000000..7b01c20d
--- /dev/null
+++ b/test/e2e/v1.js
@@ -0,0 +1,113 @@
+var webdriver = require('selenium-webdriver');
+var createServer = require('http-server').createServer;
+var expect = require('chai').expect;
+var path = require('path')
+
+var dist = path.join(__dirname, '..', '..', 'dist');
+var specs = path.join(__dirname, '..', '..', 'test', 'specs');
+var DOCS_PORT = 8080;
+var SPEC_SERVER_PORT = 8081
+
+var headers = {
+ 'Access-Control-Allow-Origin': '*',
+ 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
+};
+
+var elements = [
+ 'swagger-ui-container',
+ 'resources_container',
+ 'api_info',
+ 'resource_pet',
+ 'resource_store',
+ 'resource_user',
+ 'header'
+];
+
+describe('swagger 1.x spec tests', function (done) {
+ this.timeout(10 * 10000);
+ var swaggerUI, specServer, driver;
+
+ before(function () {
+ swaggerUI = createServer({ root: dist, headers: headers });
+ specServer = createServer({ root: specs, headers: headers });
+ driver = new webdriver.Builder().
+ withCapabilities(webdriver.Capabilities.firefox()).build();
+
+ swaggerUI.listen(DOCS_PORT);
+ specServer.listen(SPEC_SERVER_PORT);
+
+ var swaggerSpecLocation = encodeURIComponent('http://localhost:' + SPEC_SERVER_PORT + '/v1.2/petstore/api-docs')
+ driver.get('http://localhost:' + DOCS_PORT + '/index.html?url=' + swaggerSpecLocation);
+ });
+
+ afterEach(function(){
+ it('should not have any console errors', function (done) {
+ driver.manage().logs().get('browser').then(function(browserLogs) {
+ var errors = [];
+ browserLogs.forEach(function(log){
+ // 900 and above is "error" level. Console should not have any errors
+ if (log.level.value > 900)
+ console.log('browser error message:', log.message); errors.push(log);
+ });
+ expect(errors).to.be.empty;
+ done();
+ });
+ });
+ });
+
+ it('should have "Swagger UI" in title', function (done) {
+ driver.sleep(200);
+ driver.getTitle().then(function(title) {
+ expect(title).to.contain('Swagger UI');
+ done();
+ });
+ });
+
+ elements.forEach(function (id) {
+ it('should render element: ' + id, function (done) {
+ var locator = webdriver.By.id(id)
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+ });
+
+ it('should find the contact name element', function(done){
+ var locator = webdriver.By.css('.info_name');
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the pet link', function(done){
+ var locator = webdriver.By.xpath("//*[@data-id='pet']");
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the user link', function(done){
+ var locator = webdriver.By.xpath("//*[@data-id='user']");
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the store link', function(done){
+ var locator = webdriver.By.xpath("//*[@data-id='store']");
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ after(function() {
+ swaggerUI.close();
+ specServer.close();
+ driver.quit();
+ });
+});
\ No newline at end of file
diff --git a/test/e2e/v2.js b/test/e2e/v2.js
new file mode 100644
index 00000000..985d5f23
--- /dev/null
+++ b/test/e2e/v2.js
@@ -0,0 +1,129 @@
+var webdriver = require('selenium-webdriver');
+var createServer = require('http-server').createServer;
+var expect = require('chai').expect;
+var path = require('path')
+
+var dist = path.join(__dirname, '..', '..', 'dist');
+var specs = path.join(__dirname, '..', '..', 'test', 'specs');
+var DOCS_PORT = 8080;
+var SPEC_SERVER_PORT = 8081
+
+var headers = {
+ 'Access-Control-Allow-Origin': '*',
+ 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
+};
+
+var elements = [
+ 'swagger-ui-container',
+ 'resources_container',
+ 'api_info',
+ 'resource_pet',
+ 'resource_store',
+ 'resource_user',
+ 'header'
+];
+
+describe('swagger 2.0 spec tests', function (done) {
+ this.timeout(10 * 1000);
+ var swaggerUI, specServer, driver;
+
+ before(function () {
+ swaggerUI = createServer({ root: dist, headers: headers });
+ specServer = createServer({ root: specs, headers: headers });
+ driver = new webdriver.Builder().
+ withCapabilities(webdriver.Capabilities.firefox()).build();
+
+ swaggerUI.listen(DOCS_PORT);
+ specServer.listen(SPEC_SERVER_PORT);
+
+ var swaggerSpecLocation = encodeURIComponent('http://localhost:' + SPEC_SERVER_PORT + '/v2/petstore.json')
+ driver.get('http://localhost:' + DOCS_PORT + '/index.html?url=' + swaggerSpecLocation);
+ });
+
+ afterEach(function(){
+ it('should not have any console errors', function (done) {
+ driver.manage().logs().get('browser').then(function(browserLogs) {
+ var errors = [];
+ browserLogs.forEach(function(log){
+ // 900 and above is "error" level. Console should not have any errors
+ if (log.level.value > 900)
+ console.log('browser error message:', log.message); errors.push(log);
+ });
+ expect(errors).to.be.empty;
+ done();
+ });
+ });
+ });
+
+ it('should have "Swagger UI" in title', function (done) {
+ driver.sleep(200);
+ driver.getTitle().then(function(title) {
+ expect(title).to.contain('Swagger UI');
+ done();
+ });
+ });
+
+ elements.forEach(function (id) {
+ it('should render element: ' + id, function (done) {
+ var locator = webdriver.By.id(id);
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+ });
+
+ it('should find the contact name element', function(done){
+ var locator = webdriver.By.css('.info_name');
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the contact email element', function(done){
+ var locator = webdriver.By.css('.info_email');
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the contact url element', function(done){
+ var locator = webdriver.By.css('.info_url');
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the pet link', function(done){
+ var locator = webdriver.By.xpath("//*[@data-id='pet']");
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the user link', function(done){
+ var locator = webdriver.By.xpath("//*[@data-id='user']");
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ it('should find the store link', function(done){
+ var locator = webdriver.By.xpath("//*[@data-id='store']");
+ driver.isElementPresent(locator).then(function (isPresent) {
+ expect(isPresent).to.be.true;
+ done();
+ });
+ });
+
+ after(function() {
+ swaggerUI.close();
+ specServer.close();
+ driver.quit();
+ });
+});
\ No newline at end of file
diff --git a/test/mocha.opts b/test/mocha.opts
new file mode 100644
index 00000000..63b406d2
--- /dev/null
+++ b/test/mocha.opts
@@ -0,0 +1 @@
+--recursive
\ No newline at end of file
diff --git a/test/specs/v1.2/petstore/api-docs b/test/specs/v1.2/petstore/api-docs
new file mode 100644
index 00000000..69f34632
--- /dev/null
+++ b/test/specs/v1.2/petstore/api-docs
@@ -0,0 +1,60 @@
+{
+ "apiVersion": "1.0.0",
+ "swaggerVersion": "1.2",
+ "apis": [
+ {
+ "path": "http://localhost:8081/v1.2/petstore/pet",
+ "description": "Operations about pets"
+ },
+ {
+ "path": "http://localhost:8081/v1.2/petstore/user",
+ "description": "Operations about user"
+ },
+ {
+ "path": "http://localhost:8081/v1.2/petstore/store",
+ "description": "Operations about store"
+ }
+ ],
+ "authorizations": {
+ "oauth2": {
+ "type": "oauth2",
+ "scopes": [
+ {
+ "scope": "email",
+ "description": "Access to your email address"
+ },
+ {
+ "scope": "pets",
+ "description": "Access to your pets"
+ }
+ ],
+ "grantTypes": {
+ "implicit": {
+ "loginEndpoint": {
+ "url": "http://petstore.swagger.wordnik.com/oauth/dialog"
+ },
+ "tokenName": "access_token"
+ },
+ "authorization_code": {
+ "tokenRequestEndpoint": {
+ "url": "http://petstore.swagger.wordnik.com/oauth/requestToken",
+ "clientIdName": "client_id",
+ "clientSecretName": "client_secret"
+ },
+ "tokenEndpoint": {
+ "url": "http://petstore.swagger.wordnik.com/oauth/token",
+ "tokenName": "access_code"
+ }
+ }
+ }
+ }
+ },
+ "info": {
+ "title": "Swagger Sample App",
+ "description": "This is a sample server Petstore server. You can find out more about Swagger \n at
http://swagger.wordnik.com or on irc.freenode.net, #swagger. For this sample,\n you can use the api key \"special-key\" to test the authorization filters",
+ "termsOfServiceUrl": "http://helloreverb.com/terms/",
+ "contact": "apiteam@wordnik.com",
+ "license": "Apache 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+}
\ No newline at end of file
diff --git a/test/specs/v1.2/petstore/pet b/test/specs/v1.2/petstore/pet
new file mode 100644
index 00000000..4a8439a4
--- /dev/null
+++ b/test/specs/v1.2/petstore/pet
@@ -0,0 +1,425 @@
+{
+ "apiVersion": "1.0.0",
+ "swaggerVersion": "1.2",
+ "basePath": "http://petstore.swagger.wordnik.com/api",
+ "resourcePath": "/pet",
+ "produces": [
+ "application/json",
+ "application/xml",
+ "text/plain",
+ "text/html"
+ ],
+ "apis": [
+ {
+ "path": "/pet/{petId}",
+ "operations": [
+ {
+ "method": "GET",
+ "summary": "Find pet by ID",
+ "notes": "Returns a pet based on ID",
+ "type": "Pet",
+ "nickname": "getPetById",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "petId",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "integer",
+ "format": "int64",
+ "paramType": "path",
+ "minimum": "1.0",
+ "maximum": "100000.0"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid ID supplied"
+ },
+ {
+ "code": 404,
+ "message": "Pet not found"
+ }
+ ]
+ },
+ {
+ "method": "PATCH",
+ "summary": "partial updates to a pet",
+ "notes": "",
+ "type": "array",
+ "items": {
+ "$ref": "Pet"
+ },
+ "nickname": "partialUpdate",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "consumes": [
+ "application/json",
+ "application/xml"
+ ],
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "petId",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ },
+ {
+ "name": "body",
+ "description": "Pet object that needs to be added to the store",
+ "required": true,
+ "type": "Pet",
+ "paramType": "body"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid tag value"
+ }
+ ]
+ },
+ {
+ "method": "POST",
+ "summary": "Updates a pet in the store with form data",
+ "notes": "",
+ "type": "void",
+ "nickname": "updatePetWithForm",
+ "consumes": [
+ "application/x-www-form-urlencoded"
+ ],
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "petId",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ },
+ {
+ "name": "name",
+ "description": "Updated name of the pet",
+ "required": false,
+ "type": "string",
+ "paramType": "form"
+ },
+ {
+ "name": "status",
+ "description": "Updated status of the pet",
+ "required": false,
+ "type": "string",
+ "paramType": "form"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 405,
+ "message": "Invalid input"
+ }
+ ]
+ },
+ {
+ "method": "DELETE",
+ "summary": "Deletes a pet",
+ "notes": "",
+ "type": "void",
+ "nickname": "deletePet",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "petId",
+ "description": "Pet id to delete",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid pet value"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/pet",
+ "operations": [
+ {
+ "method": "PUT",
+ "summary": "Update an existing pet",
+ "notes": "",
+ "type": "void",
+ "nickname": "updatePet",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "body",
+ "description": "Pet object that needs to be updated in the store",
+ "required": true,
+ "type": "Pet",
+ "paramType": "body"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid ID supplied"
+ },
+ {
+ "code": 404,
+ "message": "Pet not found"
+ },
+ {
+ "code": 405,
+ "message": "Validation exception"
+ }
+ ]
+ },
+ {
+ "method": "POST",
+ "summary": "Add a new pet to the store",
+ "notes": "",
+ "type": "void",
+ "nickname": "addPet",
+ "consumes": [
+ "application/json",
+ "application/xml"
+ ],
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "body",
+ "description": "Pet object that needs to be added to the store",
+ "required": true,
+ "type": "Pet",
+ "paramType": "body"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 405,
+ "message": "Invalid input"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/pet/findByStatus",
+ "operations": [
+ {
+ "method": "GET",
+ "summary": "Finds Pets by status",
+ "notes": "Multiple status values can be provided with comma seperated strings",
+ "type": "array",
+ "items": {
+ "$ref": "Pet"
+ },
+ "nickname": "findPetsByStatus",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "status",
+ "description": "Status values that need to be considered for filter",
+ "defaultValue": "available",
+ "required": true,
+ "type": "string",
+ "paramType": "query",
+ "enum": [
+ "available",
+ "pending",
+ "sold"
+ ]
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid status value"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/pet/findByTags",
+ "operations": [
+ {
+ "method": "GET",
+ "summary": "Finds Pets by tags",
+ "notes": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
+ "type": "array",
+ "items": {
+ "$ref": "Pet"
+ },
+ "nickname": "findPetsByTags",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "tags",
+ "description": "Tags to filter by",
+ "required": true,
+ "type": "string",
+ "paramType": "query"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid tag value"
+ }
+ ],
+ "deprecated": "true"
+ }
+ ]
+ },
+ {
+ "path": "/pet/uploadImage",
+ "operations": [
+ {
+ "method": "POST",
+ "summary": "uploads an image",
+ "notes": "",
+ "type": "void",
+ "nickname": "uploadFile",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ },
+ {
+ "scope": "test:nothing",
+ "description": "nothing"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "additionalMetadata",
+ "description": "Additional data to pass to server",
+ "required": false,
+ "type": "string",
+ "paramType": "form"
+ },
+ {
+ "name": "file",
+ "description": "file to upload",
+ "required": false,
+ "type": "File",
+ "paramType": "body"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "models": {
+ "Tag": {
+ "id": "Tag",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Pet": {
+ "id": "Pet",
+ "required": [
+ "id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "description": "unique identifier for the pet",
+ "minimum": "0.0",
+ "maximum": "100.0"
+ },
+ "category": {
+ "$ref": "Category"
+ },
+ "name": {
+ "type": "string"
+ },
+ "photoUrls": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "Tag"
+ }
+ },
+ "status": {
+ "type": "string",
+ "description": "pet status in the store",
+ "enum": [
+ "available",
+ "pending",
+ "sold"
+ ]
+ }
+ }
+ },
+ "Category": {
+ "id": "Category",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/specs/v1.2/petstore/store b/test/specs/v1.2/petstore/store
new file mode 100644
index 00000000..e5999444
--- /dev/null
+++ b/test/specs/v1.2/petstore/store
@@ -0,0 +1,145 @@
+{
+ "apiVersion": "1.0.0",
+ "swaggerVersion": "1.2",
+ "basePath": "http://petstore.swagger.wordnik.com/api",
+ "resourcePath": "/store",
+ "produces": [
+ "application/json"
+ ],
+ "apis": [
+ {
+ "path": "/store/order/{orderId}",
+ "operations": [
+ {
+ "method": "GET",
+ "summary": "Find purchase order by ID",
+ "notes": "For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors",
+ "type": "Order",
+ "nickname": "getOrderById",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "orderId",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid ID supplied"
+ },
+ {
+ "code": 404,
+ "message": "Order not found"
+ }
+ ]
+ },
+ {
+ "method": "DELETE",
+ "summary": "Delete purchase order by ID",
+ "notes": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
+ "type": "void",
+ "nickname": "deleteOrder",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "orderId",
+ "description": "ID of the order that needs to be deleted",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid ID supplied"
+ },
+ {
+ "code": 404,
+ "message": "Order not found"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/store/order",
+ "operations": [
+ {
+ "method": "POST",
+ "summary": "Place an order for a pet",
+ "notes": "",
+ "type": "void",
+ "nickname": "placeOrder",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "body",
+ "description": "order placed for purchasing the pet",
+ "required": true,
+ "type": "Order",
+ "paramType": "body"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid order"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "models": {
+ "Order": {
+ "id": "Order",
+ "description": "an order in the system",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "petId": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "quantity": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "status": {
+ "type": "string",
+ "description": "Order Status",
+ "enum": [
+ "placed",
+ " approved",
+ " delivered"
+ ]
+ },
+ "shipDate": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/specs/v1.2/petstore/user b/test/specs/v1.2/petstore/user
new file mode 100644
index 00000000..c9eb3f6f
--- /dev/null
+++ b/test/specs/v1.2/petstore/user
@@ -0,0 +1,299 @@
+{
+ "apiVersion": "1.0.0",
+ "swaggerVersion": "1.2",
+ "basePath": "http://petstore.swagger.wordnik.com/api",
+ "resourcePath": "/user",
+ "produces": [
+ "application/json"
+ ],
+ "apis": [
+ {
+ "path": "/user",
+ "operations": [
+ {
+ "method": "POST",
+ "summary": "Create user",
+ "notes": "This can only be done by the logged in user.",
+ "type": "void",
+ "nickname": "createUser",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "body",
+ "description": "Created user object",
+ "required": true,
+ "type": "User",
+ "paramType": "body"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/user/logout",
+ "operations": [
+ {
+ "method": "GET",
+ "summary": "Logs out current logged in user session",
+ "notes": "",
+ "type": "void",
+ "nickname": "logoutUser",
+ "authorizations": {},
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "path": "/user/createWithArray",
+ "operations": [
+ {
+ "method": "POST",
+ "summary": "Creates list of users with given input array",
+ "notes": "",
+ "type": "void",
+ "nickname": "createUsersWithArrayInput",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "body",
+ "description": "List of user object",
+ "required": true,
+ "type": "array",
+ "items": {
+ "$ref": "User"
+ },
+ "paramType": "body"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/user/createWithList",
+ "operations": [
+ {
+ "method": "POST",
+ "summary": "Creates list of users with given list input",
+ "notes": "",
+ "type": "void",
+ "nickname": "createUsersWithListInput",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "body",
+ "description": "List of user object",
+ "required": true,
+ "type": "array",
+ "items": {
+ "$ref": "User"
+ },
+ "paramType": "body"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/user/{username}",
+ "operations": [
+ {
+ "method": "PUT",
+ "summary": "Updated user",
+ "notes": "This can only be done by the logged in user.",
+ "type": "void",
+ "nickname": "updateUser",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "username",
+ "description": "name that need to be deleted",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ },
+ {
+ "name": "body",
+ "description": "Updated user object",
+ "required": true,
+ "type": "User",
+ "paramType": "body"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid username supplied"
+ },
+ {
+ "code": 404,
+ "message": "User not found"
+ }
+ ]
+ },
+ {
+ "method": "DELETE",
+ "summary": "Delete user",
+ "notes": "This can only be done by the logged in user.",
+ "type": "void",
+ "nickname": "deleteUser",
+ "authorizations": {
+ "oauth2": [
+ {
+ "scope": "test:anything",
+ "description": "anything"
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "username",
+ "description": "The name that needs to be deleted",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid username supplied"
+ },
+ {
+ "code": 404,
+ "message": "User not found"
+ }
+ ]
+ },
+ {
+ "method": "GET",
+ "summary": "Get user by user name",
+ "notes": "",
+ "type": "User",
+ "nickname": "getUserByName",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "username",
+ "description": "The name that needs to be fetched. Use user1 for testing.",
+ "required": true,
+ "type": "string",
+ "paramType": "path"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid username supplied"
+ },
+ {
+ "code": 404,
+ "message": "User not found"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/user/login",
+ "operations": [
+ {
+ "method": "GET",
+ "summary": "Logs user into the system",
+ "notes": "",
+ "type": "string",
+ "nickname": "loginUser",
+ "authorizations": {},
+ "parameters": [
+ {
+ "name": "username",
+ "description": "The user name for login",
+ "required": true,
+ "type": "string",
+ "paramType": "query"
+ },
+ {
+ "name": "password",
+ "description": "The password for login in clear text",
+ "required": true,
+ "type": "string",
+ "paramType": "query"
+ }
+ ],
+ "responseMessages": [
+ {
+ "code": 400,
+ "message": "Invalid username and password combination"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "models": {
+ "User": {
+ "id": "User",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "firstName": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ },
+ "lastName": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "password": {
+ "type": "string"
+ },
+ "phone": {
+ "type": "string"
+ },
+ "userStatus": {
+ "type": "integer",
+ "format": "int32",
+ "description": "User Status",
+ "enum": [
+ "1-registered",
+ "2-active",
+ "3-closed"
+ ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/specs/v2/petstore.json b/test/specs/v2/petstore.json
new file mode 100644
index 00000000..94d78fd3
--- /dev/null
+++ b/test/specs/v2/petstore.json
@@ -0,0 +1,930 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "description": "This is a sample server Petstore server. You can find out more about Swagger at
http://swagger.wordnik.com or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters",
+ "version": "1.0.0",
+ "title": "Swagger Petstore",
+ "termsOfService": "http://helloreverb.com/terms/",
+ "contact": {
+ "url": "http://swagger.io",
+ "name": "Your pals at Swagger",
+ "email": "apiteam@wordnik.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "host": "petstore.swagger.wordnik.com",
+ "basePath": "/v2",
+ "schemes": [
+ "http"
+ ],
+ "paths": {
+ "/pet": {
+ "post": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Add a new pet to the store",
+ "description": "",
+ "operationId": "addPet",
+ "consumes": [
+ "application/json",
+ "application/xml"
+ ],
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "pet",
+ "description": "Pet object that needs to be added to the store",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/Pet"
+ }
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Invalid input"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Update an existing pet",
+ "description": "",
+ "operationId": "updatePet",
+ "consumes": [
+ "application/json",
+ "application/xml"
+ ],
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "Pet object that needs to be added to the store",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/Pet"
+ }
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Validation exception"
+ },
+ "404": {
+ "description": "Pet not found"
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ }
+ },
+ "/pet/findByStatus": {
+ "get": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Finds Pets by status",
+ "description": "Multiple status values can be provided with comma seperated strings",
+ "operationId": "findPetsByStatus",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "status",
+ "description": "Status values that need to be considered for filter",
+ "required": false,
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "multi"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Pet"
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid status value"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ }
+ },
+ "/pet/findByTags": {
+ "get": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Finds Pets by tags",
+ "description": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
+ "operationId": "findPetsByTags",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "tags",
+ "description": "Tags to filter by",
+ "required": false,
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "multi"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Pet"
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid tag value"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ }
+ },
+ "/pet/{petId}": {
+ "get": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Find pet by ID",
+ "description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions",
+ "operationId": "getPetById",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "petId",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "integer",
+ "format": "int64"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "Pet not found"
+ },
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/Pet"
+ }
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ },
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "description": "",
+ "operationId": "updatePetWithForm",
+ "consumes": [
+ "application/x-www-form-urlencoded"
+ ],
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "petId",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Updated name of the pet",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "in": "formData",
+ "name": "status",
+ "description": "Updated status of the pet",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Invalid input"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Deletes a pet",
+ "description": "",
+ "operationId": "deletePet",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "header",
+ "name": "api_key",
+ "description": "",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "in": "path",
+ "name": "petId",
+ "description": "Pet id to delete",
+ "required": true,
+ "type": "integer",
+ "format": "int64"
+ }
+ ],
+ "responses": {
+ "400": {
+ "description": "Invalid pet value"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ }
+ },
+ "/store/order": {
+ "post": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Place an order for a pet",
+ "description": "",
+ "operationId": "placeOrder",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "order placed for purchasing the pet",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/Order"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/Order"
+ }
+ },
+ "400": {
+ "description": "Invalid Order"
+ }
+ }
+ }
+ },
+ "/store/order/{orderId}": {
+ "get": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Find purchase order by ID",
+ "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
+ "operationId": "getOrderById",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "orderId",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "Order not found"
+ },
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/Order"
+ }
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Delete purchase order by ID",
+ "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
+ "operationId": "deleteOrder",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "orderId",
+ "description": "ID of the order that needs to be deleted",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "Order not found"
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ }
+ }
+ },
+ "/user": {
+ "post": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Create user",
+ "description": "This can only be done by the logged in user.",
+ "operationId": "createUser",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "Created user object",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/User"
+ }
+ }
+ ],
+ "responses": {
+ "default": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/user/createWithArray": {
+ "post": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Creates list of users with given input array",
+ "description": "",
+ "operationId": "createUsersWithArrayInput",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "List of user object",
+ "required": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "User"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "default": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/user/createWithList": {
+ "post": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Creates list of users with given input array",
+ "description": "",
+ "operationId": "createUsersWithListInput",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "List of user object",
+ "required": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/User"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "default": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/user/login": {
+ "get": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Logs user into the system",
+ "description": "",
+ "operationId": "loginUser",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "username",
+ "description": "The user name for login",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "in": "query",
+ "name": "password",
+ "description": "The password for login in clear text",
+ "required": false,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "400": {
+ "description": "Invalid username/password supplied"
+ }
+ }
+ }
+ },
+ "/user/logout": {
+ "get": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Logs out current logged in user session",
+ "description": "",
+ "operationId": "logoutUser",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "responses": {
+ "default": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/user/{username}": {
+ "get": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Get user by user name",
+ "description": "",
+ "operationId": "getUserByName",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "username",
+ "description": "The name that needs to be fetched. Use user1 for testing. ",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "User not found"
+ },
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/User"
+ }
+ },
+ "400": {
+ "description": "Invalid username supplied"
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Updated user",
+ "description": "This can only be done by the logged in user.",
+ "operationId": "updateUser",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "username",
+ "description": "name that need to be deleted",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "Updated user object",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/User"
+ }
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "User not found"
+ },
+ "400": {
+ "description": "Invalid user supplied"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Delete user",
+ "description": "This can only be done by the logged in user.",
+ "operationId": "deleteUser",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "username",
+ "description": "The name that needs to be deleted",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "User not found"
+ },
+ "400": {
+ "description": "Invalid username supplied"
+ }
+ }
+ }
+ }
+ },
+ "securityDefinitions": {
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ },
+ "petstore_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "http://petstore.swagger.wordnik.com/api/oauth/dialog",
+ "flow": "implicit"
+ }
+ },
+ "definitions": {
+ "User": {
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "xml": {
+ "name": "id"
+ }
+ },
+ "username": {
+ "type": "string",
+ "xml": {
+ "name": "username"
+ }
+ },
+ "firstName": {
+ "type": "string",
+ "xml": {
+ "name": "firstName"
+ }
+ },
+ "lastName": {
+ "type": "string",
+ "xml": {
+ "name": "lastName"
+ }
+ },
+ "email": {
+ "type": "string",
+ "xml": {
+ "name": "email"
+ }
+ },
+ "password": {
+ "type": "string",
+ "xml": {
+ "name": "password"
+ }
+ },
+ "phone": {
+ "type": "string",
+ "xml": {
+ "name": "phone"
+ }
+ },
+ "userStatus": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "name": "userStatus"
+ },
+ "description": "User Status"
+ }
+ },
+ "xml": {
+ "name": "User"
+ }
+ },
+ "Category": {
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "xml": {
+ "name": "id"
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "name": "name"
+ }
+ }
+ },
+ "xml": {
+ "name": "Category"
+ }
+ },
+ "Pet": {
+ "required": [
+ "name",
+ "photoUrls"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "xml": {
+ "name": "id"
+ }
+ },
+ "category": {
+ "xml": {
+ "name": "category"
+ },
+ "$ref": "Category"
+ },
+ "name": {
+ "type": "string",
+ "example": "doggie",
+ "xml": {
+ "name": "name"
+ }
+ },
+ "photoUrls": {
+ "type": "array",
+ "xml": {
+ "name": "photoUrl",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "xml": {
+ "name": "tag",
+ "wrapped": true
+ },
+ "items": {
+ "$ref": "Tag"
+ }
+ },
+ "status": {
+ "type": "string",
+ "xml": {
+ "name": "status"
+ },
+ "description": "pet status in the store"
+ }
+ },
+ "xml": {
+ "name": "Pet"
+ }
+ },
+ "Tag": {
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "xml": {
+ "name": "id"
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "name": "name"
+ }
+ }
+ },
+ "xml": {
+ "name": "Tag"
+ }
+ },
+ "Order": {
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "xml": {
+ "name": "id"
+ }
+ },
+ "petId": {
+ "type": "integer",
+ "format": "int64",
+ "xml": {
+ "name": "petId"
+ }
+ },
+ "quantity": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "name": "quantity"
+ }
+ },
+ "shipDate": {
+ "type": "string",
+ "format": "date-time",
+ "xml": {
+ "name": "shipDate"
+ }
+ },
+ "status": {
+ "type": "string",
+ "xml": {
+ "name": "status"
+ },
+ "description": "Order Status"
+ },
+ "complete": {
+ "type": "boolean"
+ }
+ },
+ "xml": {
+ "name": "Order"
+ }
+ }
+ }
+}
\ No newline at end of file