Skip to content

Instantly share code, notes, and snippets.

@eiel
Created March 3, 2016 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiel/862b914b1c2bde21282f to your computer and use it in GitHub Desktop.
Save eiel/862b914b1c2bde21282f to your computer and use it in GitHub Desktop.
{
"swagger" : "2.0",
"info" : {
"description" : "サンプルドキュメント",
"version" : "1.0.0",
"title" : "Example API"
},
"host" : "api.example.com",
"basePath" : "/v1",
"schemes" : [ "https" ],
"produces" : [ "application/json" ],
"paths" : {
"/self/home" : {
"get" : {
"tags" : [ "self" ],
"summary" : "自分の情報",
"description" : "自分の情報\n",
"parameters" : [ {
"name" : "access_token",
"in" : "header",
"description" : "ユーザー情報を示すアクセストークン",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "An array of products",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Event"
}
},
"examples" : {
"application/json" : [ {
"title" : "たいとる",
"images" : [ "URL" ]
} ]
}
},
"default" : {
"description" : "Unexpected error",
"schema" : {
"$ref" : "#/definitions/Error"
}
}
}
}
}
},
"definitions" : {
"Event" : {
"type" : "object",
"properties" : {
"title" : {
"type" : "string",
"description" : "イベント名"
},
"images" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"location" : {
"$ref" : "#/definitions/Locoation"
},
"date" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"time" : {
"type" : "string"
},
"user" : {
"$ref" : "#/definitions/User"
}
}
},
"Locoation" : {
"type" : "object",
"properties" : {
"latitude" : {
"type" : "number"
},
"longitude" : {
"type" : "number"
},
"name" : {
"type" : "string"
}
}
},
"User" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "number"
},
"name" : {
"type" : "string"
},
"icon" : {
"type" : "string"
}
}
},
"Error" : {
"type" : "object",
"properties" : {
"code" : {
"type" : "integer",
"format" : "int32"
},
"message" : {
"type" : "string"
},
"fields" : {
"type" : "string"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment