Instantly share code, notes, and snippets.
Last active
May 4, 2022 16:20
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save sedkis/d707e75b072e4f22fe0c8a46f0d8c15e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger":"2.0", | |
"info":{ | |
"description":"Social Media API", | |
"version":"1.0.0", | |
"title":"Social Media API" | |
}, | |
"host":"34.148.19.142:8080", | |
"tags":[ | |
{ | |
"name":"posts" | |
}, | |
{ | |
"name":"comments" | |
}, | |
{ | |
"name":"albums" | |
}, | |
{ | |
"name":"photos" | |
}, | |
{ | |
"name":"todos" | |
}, | |
{ | |
"name":"users" | |
} | |
], | |
"schemes":[ | |
"https" | |
], | |
"paths":{ | |
"/posts":{ | |
"get":{ | |
"tags":[ | |
"posts" | |
], | |
"operationId":"getPosts", | |
"summary":"Get all available posts", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by post ID", | |
"required":false | |
}, | |
{ | |
"name":"userId", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by user ID", | |
"required":false | |
} | |
], | |
"produces":[ | |
"application/json" | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Post" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/posts/{id}":{ | |
"get":{ | |
"tags":[ | |
"posts" | |
], | |
"summary":"Get specific post", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"The ID of the post to retrieve", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"$ref":"#/definitions/Post" | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/posts/{id}/comments":{ | |
"get":{ | |
"tags":[ | |
"posts" | |
], | |
"summary":"Get comments for a specific post", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"post id", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Comment" | |
} | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/comments":{ | |
"get":{ | |
"tags":[ | |
"comments" | |
], | |
"operationId":"getComments", | |
"summary":"Get all available comments", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by comment ID", | |
"required":false | |
}, | |
{ | |
"name":"postId", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by post ID", | |
"required":false | |
} | |
], | |
"produces":[ | |
"application/json" | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Comment" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/comments/{id}":{ | |
"get":{ | |
"tags":[ | |
"comments" | |
], | |
"operationId":"getComment", | |
"summary":"Get specific comment", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"The ID of the comment to retrieve", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"$ref":"#/definitions/Comment" | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/albums":{ | |
"get":{ | |
"tags":[ | |
"albums" | |
], | |
"operationId":"getAlbums", | |
"summary":"Get all available albums", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by album ID", | |
"required":false | |
}, | |
{ | |
"name":"userId", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by user ID", | |
"required":false | |
} | |
], | |
"produces":[ | |
"application/json" | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Album" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/albums/{id}":{ | |
"get":{ | |
"tags":[ | |
"albums" | |
], | |
"summary":"Get specific album", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"The ID of the album to retrieve", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"$ref":"#/definitions/Album" | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/albums/{id}/photos":{ | |
"get":{ | |
"tags":[ | |
"albums" | |
], | |
"summary":"Get photos for a specific album", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"post id", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Photo" | |
} | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/photos":{ | |
"get":{ | |
"tags":[ | |
"photos" | |
], | |
"operationId":"getPhotos", | |
"summary":"Get all available photos", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by photo ID", | |
"required":false | |
}, | |
{ | |
"name":"albumId", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by album ID", | |
"required":false | |
} | |
], | |
"produces":[ | |
"application/json" | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Photo" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/photos/{id}":{ | |
"get":{ | |
"tags":[ | |
"photos" | |
], | |
"operationId":"getPhoto", | |
"summary":"Get specific photo", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"The ID of the photo to retrieve", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"$ref":"#/definitions/Photo" | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/todos":{ | |
"get":{ | |
"tags":[ | |
"todos" | |
], | |
"operationId":"getTodos", | |
"summary":"Get all available todos", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by todo ID", | |
"required":false | |
}, | |
{ | |
"name":"userId", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by user ID", | |
"required":false | |
} | |
], | |
"produces":[ | |
"application/json" | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/Todo" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/todos/{id}":{ | |
"get":{ | |
"tags":[ | |
"todos" | |
], | |
"operationId":"getTodo", | |
"summary":"Get specific todo", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"The ID of the todo to retrieve", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"$ref":"#/definitions/Todo" | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
}, | |
"/users":{ | |
"get":{ | |
"tags":[ | |
"users" | |
], | |
"operationId":"getUsers", | |
"summary":"Get all available users", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by user ID", | |
"required":false | |
}, | |
{ | |
"name":"email", | |
"in":"query", | |
"type":"integer", | |
"description":"Filter by user email address", | |
"required":false | |
} | |
], | |
"produces":[ | |
"application/json" | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/User" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/users/{id}":{ | |
"get":{ | |
"tags":[ | |
"users" | |
], | |
"operationId":"getUser", | |
"summary":"Get specific user", | |
"parameters":[ | |
{ | |
"name":"id", | |
"in":"path", | |
"description":"The ID of the user to retrieve", | |
"required":true, | |
"type":"integer" | |
} | |
], | |
"responses":{ | |
"200":{ | |
"description":"successful operation", | |
"schema":{ | |
"$ref":"#/definitions/User" | |
} | |
}, | |
"404":{ | |
"description":"not found", | |
"schema":{ | |
"$ref":"#/definitions/NotFoundError" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"definitions":{ | |
"Post":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"userId":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"title":{ | |
"type":"string" | |
}, | |
"body":{ | |
"type":"string" | |
} | |
} | |
}, | |
"Comment":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"postId":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"name":{ | |
"type":"string" | |
}, | |
"email":{ | |
"type":"string", | |
"format":"email" | |
}, | |
"body":{ | |
"type":"string" | |
} | |
} | |
}, | |
"Album":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"userId":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"title":{ | |
"type":"string" | |
} | |
} | |
}, | |
"Photo":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"albumId":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"title":{ | |
"type":"string" | |
}, | |
"url":{ | |
"type":"string", | |
"format":"uri" | |
}, | |
"thumbnailUrl":{ | |
"type":"string", | |
"format":"uri" | |
} | |
} | |
}, | |
"Todo":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"userId":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"title":{ | |
"type":"string" | |
}, | |
"completed":{ | |
"type":"boolean" | |
} | |
} | |
}, | |
"User":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"integer", | |
"format":"int64" | |
}, | |
"name":{ | |
"type":"string" | |
}, | |
"username":{ | |
"type":"string" | |
}, | |
"email":{ | |
"type":"string", | |
"format":"email" | |
}, | |
"phone":{ | |
"type":"string" | |
}, | |
"website":{ | |
"type":"string" | |
}, | |
"company":{ | |
"type":"object", | |
"properties":{ | |
"name":{ | |
"type":"string" | |
}, | |
"catchPhrase":{ | |
"type":"string" | |
}, | |
"bs":{ | |
"type":"string" | |
} | |
} | |
}, | |
"address":{ | |
"type":"object", | |
"properties":{ | |
"street":{ | |
"type":"string" | |
}, | |
"suite":{ | |
"type":"string" | |
}, | |
"city":{ | |
"type":"string" | |
}, | |
"zipcode":{ | |
"type":"string" | |
}, | |
"geo":{ | |
"type":"object", | |
"properties":{ | |
"lat":{ | |
"type":"string" | |
}, | |
"lng":{ | |
"type":"string" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"NotFoundError":{ | |
"type":"object" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment