Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,12 @@ public void testIssue289() {
Swagger swagger = result.getSwagger();
assertNotNull(swagger.getPath("/foo").getGet());
}

@Test
public void testIssue336() {
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("./src/test/resources/nested-file-references/issue-336.json", null, true);
assertNotNull(result.getSwagger());

Swagger swagger = result.getSwagger();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "Currency code",
"type": "string",
"minLength": 3,
"maxLength": 3
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"type":"object",
"title":"error",
"description":"Details of an Error",
"properties":{
"name":{
"type":"string",
"description":"Human readable, unique name of the error."
},
"debug_id":{
"type":"string",
"description":"Used for correlation purposes."
},
"message":{
"type":"string",
"description":"Message describing the error."
},
"information_link":{
"type":"string",
"description":"URI for detailed information related to this error for the developer."
},
"details":{
"type":"array",
"description":"Additional details of the error",
"items":{
"$ref":"../common/issue-336-error_details.json"
}
},
"links":{
"type":"array",
"description":"Error context specific HATEOAS links",
"items":{
"$ref":"../common/issue-336-link_description.json"
}
}
},
"required" : [ "name", "debug_id", "message"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type":"object",
"title":"Error Details",
"description":"Details about a specific error.",
"properties":{
"field":{
"type":"string",
"description":"Field that caused the error."
},
"value":{
"type":"string",
"description":"Value of the field that caused the error."
},
"location":{
"type":"string",
"description":"Location of the field that caused the error. Possible values are body (default), path and query"
},
"issue":{
"type":"string",
"description":"Reason for the error."
}
},
"required" : ["issue"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"title": "Link Description Object",
"type": "object",
"required": [ "href", "rel" ],
"properties": {
"href": {
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
"type": "string"
},
"rel": {
"description": "relation to the target resource of the link",
"type": "string"
},
"title": {
"description": "a title for the link",
"type": "string"
},
"mediaType": {
"description": "media type (as defined by RFC 2046) describing the link target",
"type": "string"
},
"method": {
"description": "method for requesting",
"type": "string"
},
"encType": {
"description": "The media type in which to submit data along with the request",
"type": "string",
"default": "application/json"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Abhi service",
"description": "A sample application to test out integration of swagger",
"contact": {
"email": "abhi.predator@gmail.com"
}
},
"schemes": [
"http"
],
"basePath": "/v1/library",
"tags": [
{
"name": "Titles",
"description": "Description"
}
],
"produces": [
"application/json"
],
"paths": {
"/titles": {
"get": {
"description": "Gets titles as part of Raptor 3 training",
"tags": [
"Titles"
],
"summary": "Get all titles",
"operationId": "findTitles",
"parameters": [
{
"in": "query",
"name": "multiple_type",
"description": "multipletypes",
"required": false,
"type": "array",
"minItems": 0,
"maxItems": 3,
"items": {
"type": "string"
},
"collectionFormat": "multi"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "array",
"items": {
"$ref": "./title/issue-336-title.json"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "./common/issue-336-error.json"
}
}
}
},
"post": {
"description": "Creating a new title",
"tags": [
"Titles"
],
"summary": "Create a new title",
"operationId": "createTitle",
"parameters": [
{
"in": "body",
"name": "Title",
"description": "Title for creation",
"required": true,
"schema": {
"$ref": "./title/issue-336-title.json"
}
}
],
"responses": {
"201": {
"description": "Successfully created"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "./common/issue-336-error.json"
}
}
}
}
},
"/titles/{id}": {
"get": {
"summary": "Get a title",
"tags": [
"Titles"
],
"description": "",
"operationId": "getTitle",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Get title for given id",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Title not found"
}
}
},
"put": {
"summary": "Update a title",
"tags": [
"Titles"
],
"description": "",
"operationId": "updateTitle",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Update a title",
"required": true,
"type": "integer",
"format": "int64"
},
{
"in": "body",
"name": "Title",
"description": "Title for update",
"required": true,
"schema": {
"$ref": "./title/issue-336-title.json"
}
}
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Title not found"
}
}
},
"delete": {
"summary": "Deletes a title",
"tags": [
"Titles"
],
"description": "",
"operationId": "deleteTitle",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Title id to delete",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Title not found"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "object",
"title":"copy",
"description":"Copy of a title",
"properties": {
"barcode": {
"type": "string",
"pattern": "^[0-9]{1,38}$",
"description": "Barcode for the title"
},
"qr_code": {
"type": "string",
"description": "QR code for the title"
},
"known_defect": {
"type": "string",
"description": "Known defects"
}
}
}
Loading