Updated swagger-parser from v1.0.8 to v1.0.13

Support for global responses and parameters
This commit is contained in:
Robert Winkler
2015-11-09 14:52:43 +01:00
parent f21fce7730
commit 1e6be2f26d
4 changed files with 41 additions and 28 deletions

View File

@@ -63,4 +63,8 @@
== Version 0.8.0 == Version 0.8.0
* Enhancement #26 and #27: Added a pre-process hook to modify a Swagger Model before it is converted. * Enhancement #26 and #27: Added a pre-process hook to modify a Swagger Model before it is converted.
* Bugfix #29: Tags are rendered twice * Bugfix #29: Tags are rendered twice
=== Version 0.9.0
* Updated swagger-parser from v1.0.8 to v1.0.13
* Support for global responses and parameters

View File

@@ -13,7 +13,7 @@ buildscript {
} }
} }
description = 'swagger2markup Build' description = 'swagger2markup Build'
version = '0.8.0' version = '0.9.0'
group = 'io.github.robwin' group = 'io.github.robwin'
apply plugin: 'java' apply plugin: 'java'
@@ -54,7 +54,7 @@ dependencies {
dependencyManagement { dependencyManagement {
dependencies { dependencies {
dependency "io.github.robwin:markup-document-builder:0.1.4" dependency "io.github.robwin:markup-document-builder:0.1.4"
dependency "io.swagger:swagger-compat-spec-parser:1.0.8" dependency "io.swagger:swagger-compat-spec-parser:1.0.13"
dependency "commons-collections:commons-collections:3.2.1" dependency "commons-collections:commons-collections:3.2.1"
dependency "commons-io:commons-io:2.4" dependency "commons-io:commons-io:2.4"
dependency "junit:junit:4.11" dependency "junit:junit:4.11"

View File

@@ -21,9 +21,7 @@ package io.github.robwin.swagger2markup;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.robwin.markup.builder.MarkupLanguage; import io.github.robwin.markup.builder.MarkupLanguage;
import io.github.robwin.swagger2markup.builder.document.DefinitionsDocument; import io.github.robwin.swagger2markup.builder.document.*;
import io.github.robwin.swagger2markup.builder.document.OverviewDocument;
import io.github.robwin.swagger2markup.builder.document.PathsDocument;
import io.github.robwin.swagger2markup.utils.Consumer; import io.github.robwin.swagger2markup.utils.Consumer;
import io.swagger.models.Swagger; import io.swagger.models.Swagger;
import io.swagger.parser.SwaggerParser; import io.swagger.parser.SwaggerParser;
@@ -156,8 +154,8 @@ public class Swagger2MarkupConverter {
* @return a the document as a String * @return a the document as a String
*/ */
private String buildDocuments() throws IOException { private String buildDocuments() throws IOException {
return new OverviewDocument(swagger, markupLanguage).build().toString().concat( return new OverviewDocument(swagger, markupLanguage).build().toString()
new PathsDocument(swagger, markupLanguage, examplesFolderPath, schemasFolderPath).build().toString() .concat(new PathsDocument(swagger, markupLanguage, examplesFolderPath, schemasFolderPath).build().toString()
.concat(new DefinitionsDocument(swagger, markupLanguage, schemasFolderPath, schemasFolderPath, false, null).build().toString())); .concat(new DefinitionsDocument(swagger, markupLanguage, schemasFolderPath, schemasFolderPath, false, null).build().toString()));
} }

View File

@@ -134,13 +134,7 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "$ref": "#/responses/FoundPets"
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
}, },
"400": { "400": {
"description": "Invalid status value" "description": "Invalid status value"
@@ -183,13 +177,7 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "$ref": "#/responses/FoundPets"
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
}, },
"400": { "400": {
"description": "Invalid tag value" "description": "Invalid tag value"
@@ -219,12 +207,7 @@
], ],
"parameters": [ "parameters": [
{ {
"in": "path", "$ref": "#/parameters/petId"
"name": "petId",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"format": "int64"
} }
], ],
"responses": { "responses": {
@@ -729,6 +712,27 @@
} }
} }
}, },
"responses":{
"FoundPets": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
}
},
"parameters":{
"petId": {
"in": "path",
"name": "petId",
"description": "ID of the pet",
"required": true,
"type": "integer",
"format": "int64"
}
},
"definitions": { "definitions": {
"Identified": { "Identified": {
"properties": { "properties": {
@@ -767,6 +771,13 @@
"type": "integer", "type": "integer",
"format": "int32", "format": "int32",
"description": "User Status" "description": "User Status"
},
"pictures": {
"type": "array",
"items": {
"type": "string",
"format": "byte"
}
} }
} }
} }