Skip to content

Instantly share code, notes, and snippets.

@caoilte caoilte/gist:5241423

Created Mar 25, 2013
Embed
What would you like to do?
When I compile and run https://github.com/wordnik/swagger-core/tree/master/samples/scala-scalatra/ and look at the API doc URI for Pet http://localhost:8080/api-docs/pet I get
{
resourcePath: "/pet",
listingPath: "/api-docs/pet",
description: "Pet API",
apis: [
{
path: "/pet/",
description: "",
secured: false,
operations: [
{
httpMethod: "PUT",
responseClass: "void",
summary: "Update an existing pet",
deprecated: false,
nickname: "updatePet",
parameters: [
{
name: "body",
description: "Pet object to update in the store",
required: true,
paramType: "body",
allowMultiple: false,
dataType: "Pet"
}
],
errorResponses: [ ]
},
{
httpMethod: "POST",
responseClass: "void",
summary: "Add a new pet tot he store",
deprecated: false,
nickname: "addPet",
parameters: [
{
name: "body",
description: "Pet object to add to the store",
required: true,
paramType: "body",
allowMultiple: false,
dataType: "Pet"
}
],
errorResponses: [ ]
}
]
},
{
path: "/pet/findByStatus",
description: "",
secured: false,
operations: [
{
httpMethod: "GET",
responseClass: "List[Pet]",
summary: "Finds Pets by status",
deprecated: false,
nickname: "findPetsByStatus",
parameters: [
{
name: "status",
description: "Status values that need to be considered for filter",
allowableValues: {
valueType: "LIST",
values: [
"available",
"pending",
"sold"
]
},
required: true,
paramType: "query",
allowMultiple: false,
dataType: "string"
}
],
errorResponses: [ ]
}
]
},
{
path: "/pet/findByTags",
description: "",
secured: false,
operations: [
{
httpMethod: "GET",
responseClass: "List[Pet]",
summary: "Finds Pets by tags",
deprecated: false,
nickname: "findPetsByStatus",
parameters: [
{
name: "tags",
description: "Tags to filter by",
required: true,
paramType: "query",
allowMultiple: false,
dataType: "string"
}
],
errorResponses: [ ]
}
]
},
{
path: "/pet/{petId}",
description: "",
secured: false,
operations: [
{
httpMethod: "GET",
responseClass: "Pet",
summary: "Find pet by ID",
notes: "Returns a pet based on ID",
deprecated: false,
nickname: "getPetById",
parameters: [
{
name: "petId",
description: "ID of pet that needs to be fetched",
required: true,
paramType: "path",
allowMultiple: false,
dataType: "string"
}
],
errorResponses: [ ]
}
]
}
],
models: {
Tag: {
id: "Tag",
description: "Tag",
properties: {
name: {
description: null,
enum: [ ],
required: true,
type: "string"
},
id: {
description: null,
enum: [ ],
required: true,
type: "long"
}
}
},
Category: {
id: "Category",
description: "Category",
properties: {
name: {
description: null,
enum: [ ],
required: true,
type: "string"
},
id: {
description: null,
enum: [ ],
required: true,
type: "long"
}
}
},
Pet: {
id: "Pet",
description: "Pet",
properties: {
name: {
description: null,
enum: [ ],
required: true,
type: "string"
},
tags: {
description: null,
enum: [ ],
required: true,
type: "Array",
uniqueItems: false,
items: {
$ref: "Tag"
}
},
photoUrls: {
description: null,
enum: [ ],
required: true,
type: "Array",
uniqueItems: false,
items: {
type: "string"
}
},
id: {
description: null,
enum: [ ],
required: true,
type: "long"
},
status: {
description: null,
enum: [ ],
required: true,
type: "string"
},
category: {
description: null,
enum: [ ],
required: true,
type: "Category"
}
}
}
},
basePath: "http://localhost:8080",
swaggerVersion: "1.1",
apiVersion: "1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.