Skip to content

Instantly share code, notes, and snippets.

@aaronmccall
Created April 11, 2012 00:35
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 aaronmccall/309055b2c1401918e2f1 to your computer and use it in GitHub Desktop.
Save aaronmccall/309055b2c1401918e2f1 to your computer and use it in GitHub Desktop.
Swagger resource files
{
"basePath": "http://localhost:3000",
"swaggerVersion": "1.1-SHAPSHOT.121026",
"apiVersion": 0.1,
"apis": [
{
"path": "/user",
"description": "Operations for users"
},
{
"path": "/team",
"description": "Operations for teams"
}
]
}
{
"description": "Operations for teams",
"resourcePath": "/team",
"basePath": "http://localhost:3000",
"swaggerVersion": "1.1-SHAPSHOT.121026",
"apiVersion": 0.1,
"apis": [
{
"path": "/team",
"description": "Create team",
"operations": [
{
"parameters": [
{
"description": "Create instance of Team",
"dataType": "team",
"required": true,
"valueTypeInternal": "models.team.Team",
"allowMultiple": false,
"paramType": "body"
}
],
"httpMethod": "POST",
"responseTypeInternal": "models.team.Team",
"nickname": "postTeam",
"responseClass": "team"
}
]
},
{
"path": "/team/{teamId}",
"description": "Team operations",
"operations": [
{
"parameters": [
{
"name": "teamId",
"description": "The name that needs to be fetched. Use team1 for testing.",
"dataType": "string",
"required": true,
"allowMultiple": false,
"paramType": "path"
}
],
"httpMethod": "GET",
"responseTypeInternal": "models.team.Team",
"nickname": "getTeam",
"responseClass": "team"
},
{
"parameters": [
{
"name": "teamId",
"description": "The name that needs to be fetched. Use team1 for testing.",
"dataType": "team",
"valueTypeInternal": "models.team.Team",
"required": true,
"allowMultiple": false,
"paramType": "body"
}
],
"httpMethod": "PUT",
"responseTypeInternal": "models.team.Team",
"nickname": "updateTeam",
"responseClass": "team"
},
{
"parameters": [
{
"name": "teamId",
"description": "The name that needs to be fetched. Use team1 for testing.",
"dataType": "team",
"valueTypeInternal": "models.team.Team",
"required": true,
"allowMultiple": false,
"paramType": "body"
}
],
"httpMethod": "DELETE",
"responseTypeInternal": "ok",
"nickname": "deleteTeam",
"responseClass": "ok"
}
]
}
],
"models": {
"Team": {
"properties": {
"inc": {
"type": "number",
"access": "readonly"
},
"created": {
"type": "date",
"access": "readonly"
}
}
}
}
}
{
"description": "Operations for users",
"resourcePath": "/user",
"basePath": "http://localhost:3000",
"swaggerVersion": "1.1-SHAPSHOT.121026",
"apiVersion": 0.1,
"apis": [
{
"path": "/user",
"description": "Create user",
"operations": [
{
"parameters": [
{
"description": "Create instance of User",
"dataType": "user",
"required": true,
"valueTypeInternal": "models.user.User",
"allowMultiple": false,
"paramType": "body"
}
],
"httpMethod": "POST",
"responseTypeInternal": "models.user.User",
"nickname": "postUser",
"responseClass": "user"
}
]
},
{
"path": "/user/{userId}",
"description": "User operations",
"operations": [
{
"parameters": [
{
"name": "userId",
"description": "The name that needs to be fetched. Use user1 for testing.",
"dataType": "string",
"required": true,
"allowMultiple": false,
"paramType": "path"
}
],
"httpMethod": "GET",
"responseTypeInternal": "models.user.User",
"nickname": "getUser",
"responseClass": "user"
},
{
"parameters": [
{
"name": "userId",
"description": "The name that needs to be fetched. Use user1 for testing.",
"dataType": "user",
"valueTypeInternal": "models.user.User",
"required": true,
"allowMultiple": false,
"paramType": "body"
}
],
"httpMethod": "PUT",
"responseTypeInternal": "models.user.User",
"nickname": "updateUser",
"responseClass": "user"
},
{
"parameters": [
{
"name": "userId",
"description": "The name that needs to be fetched. Use user1 for testing.",
"dataType": "user",
"valueTypeInternal": "models.user.User",
"required": true,
"allowMultiple": false,
"paramType": "body"
}
],
"httpMethod": "DELETE",
"responseTypeInternal": "ok",
"nickname": "deleteUser",
"responseClass": "ok"
}
]
}
],
"models": {
"User": {
"properties": {
"id": {
"type": "string",
"description": "UUIDv4",
"access": "readonly"
},
"inc": {
"type": "number",
"access": "readonly"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
},
"firstName": {
"type": "string",
"required": true
},
"lastName": {
"type": "string",
"required": true
},
"email": {
"type": "string",
"required": true,
"unique": true
},
"didTutorial": {
"type": "boolean",
"required": true
},
"muted": {
"type": "boolean",
"required": true
},
"textSize": {
"type": "string",
"required": true
},
"jid": {
"type": "string",
"unique": true
},
"cellNumber": {
"type": "string",
"unique": true
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment