Skip to content

Instantly share code, notes, and snippets.

@doofmars
Created October 9, 2016 19:54
Show Gist options
  • Save doofmars/b8486aa3f148f40236aeee7d5eebda56 to your computer and use it in GitHub Desktop.
Save doofmars/b8486aa3f148f40236aeee7d5eebda56 to your computer and use it in GitHub Desktop.
Just a Swagger.json sample test
{
"swagger" : "2.0",
"info" : {
"version" : "1.0.2",
"title" : "Sample API"
},
"host" : "localhost:8002",
"basePath" : "/api",
"tags" : [ {
"name" : "weather"
} ],
"schemes" : [ "http" ],
"paths" : {
"/weather" : {
"get" : {
"tags" : [ "weather" ],
"summary" : "Get weather for given town",
"description" : "",
"operationId" : "getPeriod",
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "town",
"in" : "query",
"description" : "location for weather info",
"required" : false,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "weather info for town",
"schema" : {
"$ref" : "#/definitions/Info"
}
},
"400" : {
"description" : "No town submitted"
}
}
}
}
},
"definitions" : {
"Info" : {
"type" : "object",
"properties" : {
"temperature" : {
"type" : "integer",
"format" : "int32"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment