-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.json
1 lines (1 loc) · 9.01 KB
/
openapi.json
1
{"swagger": "2.0", "info": {"title": "QuickComm API", "description": "A distributed social network.", "license": {"name": "Apache License 2.0"}, "version": "0.0.1"}, "host": "localhost:8000", "schemes": ["http"], "basePath": "/api", "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"BasicAuth": {"type": "http", "scheme": "basic"}}, "security": [], "paths": {"/authors/": {"get": {"operationId": "authors_list", "summary": "Get a list of all authors.", "description": "This endpoint returns a list of all authors on the server.", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/Authors"}}}, "tags": ["authors"]}, "parameters": []}, "/authors/{authors_pk}/posts/": {"get": {"operationId": "authors_posts_list", "summary": "Get a list of all posts for a specific author.", "description": "This endpoint returns a list of all posts for a specific author.", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/Posts"}}, "404": {"description": "Author not found"}}, "tags": ["authors > posts"]}, "post": {"operationId": "authors_posts_create", "summary": "Create a new post.", "description": "This endpoint allows you to create a new post. You must be authenticated as the author to do this.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Post"}}], "responses": {"200": {"description": "Success"}, "404": {"description": "Author not found"}, "403": {"description": "Not authorized"}}, "tags": ["authors > posts"], "security": [{"BasicAuth": []}]}, "parameters": [{"name": "authors_pk", "in": "path", "required": true, "type": "string"}]}, "/authors/{authors_pk}/posts/{id}/": {"get": {"operationId": "authors_posts_read", "summary": "Get the details of a specific post.", "description": "This endpoint returns the details of a specific post.", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/Post"}}, "404": {"description": "Post not found"}}, "tags": ["authors > posts"]}, "post": {"operationId": "authors_posts_partial_update", "summary": "Perform a partial update of a specific post.", "description": "This endpoint allows you to update parts of a post. You must be authenticated as the author to do this.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Post"}}], "responses": {"200": {"description": "Success"}, "404": {"description": "Author not found"}, "403": {"description": "Not authorized"}}, "tags": ["authors > posts"], "security": [{"BasicAuth": []}]}, "put": {"operationId": "authors_posts_update", "summary": "Replace the contents of a post.", "description": "This endpoint allows you to replace the contents of a post. You must be authenticated as the author to do this.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Post"}}], "responses": {"200": {"description": "Success"}, "404": {"description": "Post not found"}, "403": {"description": "Not authorized"}}, "tags": ["authors > posts"], "security": [{"BasicAuth": []}]}, "delete": {"operationId": "authors_posts_delete", "summary": "Delete a specific post.", "description": "This endpoint allows you to delete a post. You must be authenticated as the author to do this.", "parameters": [], "responses": {"200": {"description": "Success"}, "404": {"description": "Post not found"}, "403": {"description": "Not authorized"}}, "tags": ["authors > posts"], "security": [{"BasicAuth": []}]}, "parameters": [{"name": "authors_pk", "in": "path", "required": true, "type": "string"}, {"name": "id", "in": "path", "description": "A UUID string identifying this post.", "required": true, "type": "string", "format": "uuid"}]}, "/authors/{id}/": {"get": {"operationId": "authors_read", "summary": "Get the details of a specific author.", "description": "This endpoint returns the details of a specific author.", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/Author"}}, "404": {"description": "Author not found"}}, "tags": ["authors"]}, "post": {"operationId": "authors_partial_update", "summary": "Update parts of an author.", "description": "This endpoint allows you to update parts of an author's profile. You must be authenticated as the author to do this.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Author"}}], "responses": {"200": {"description": "Success"}, "404": {"description": "Author not found"}, "403": {"description": "Not authorized"}}, "tags": ["authors"], "security": [{"BasicAuth": []}]}, "parameters": [{"name": "id", "in": "path", "description": "A UUID string identifying this author.", "required": true, "type": "string", "format": "uuid"}]}}, "definitions": {"Author": {"type": "object", "properties": {"type": {"title": "Type", "type": "string", "readOnly": true, "default": "author", "minLength": 1, "example": "author", "description": "The type of object. Must be 'author'."}, "id": {"title": "Id", "type": "string", "format": "uri", "readOnly": true, "example": "http://localhost:8000/api/authors/de574df8-6543-4566-b1cb-8cb74c70e8be/", "description": "The unique identifier for the author."}, "url": {"title": "Url", "type": "string", "format": "uri", "readOnly": true, "example": "http://localhost:8000/api/authors/de574df8-6543-4566-b1cb-8cb74c70e8be/", "description": "The URL of the author."}, "host": {"title": "Host", "type": "string", "format": "uri", "minLength": 1, "example": "http://localhost:8000/", "description": "The host machine of the author. This is where the author's profile is hosted."}, "displayName": {"title": "Displayname", "type": "string", "minLength": 1, "example": "Greg Johnson", "description": "The display name of the author."}, "github": {"title": "Github", "type": "string", "format": "uri", "minLength": 1, "example": "gjohnson", "description": "The username of a GitHub profile."}, "profileImage": {"title": "Profileimage", "type": "string", "format": "uri", "minLength": 1, "example": "https://i.imgur.com/k7XVwpB.jpeg", "description": "The URL of the author's profile image. This can be hosted anywhere."}}}, "Authors": {"type": "object", "properties": {"type": {"title": "Type", "type": "string", "readOnly": true, "default": "authors", "minLength": 1}, "data": {"type": "array", "items": {"$ref": "#/definitions/Author"}, "readOnly": true}}}, "Post": {"type": "object", "properties": {"type": {"title": "Type", "type": "string", "readOnly": true, "default": "post", "minLength": 1, "example": "post", "description": "The type of object. Must be 'post'."}, "id": {"title": "Id", "type": "string", "readOnly": true, "example": "http://localhost:8000/api/authors/e3b90f3f-1c01-4b60-aaf6-01a1554505df/posts/eb5901f2-b85b-4656-8940-c85dedab7b91/", "description": "The unique identifier for the post."}, "url": {"title": "Url", "type": "string", "readOnly": true, "example": "http://localhost:8000/api/authors/e3b90f3f-1c01-4b60-aaf6-01a1554505df/posts/eb5901f2-b85b-4656-8940-c85dedab7b91/", "description": "The URL of the post."}, "title": {"title": "Title", "type": "string", "minLength": 1, "example": "A post title about a post about web dev", "description": "The title of the post."}, "source": {"title": "Source", "type": "string", "format": "uri", "minLength": 1, "example": "http://lastplaceigotthisfrom.com/posts/yyyyy", "description": "The URL of where this post was taken from."}, "origin": {"title": "Origin", "type": "string", "format": "uri", "minLength": 1, "example": "http://whereitcamefrom.com/posts/zzzzz", "description": "The URL of where this post was originally from."}, "description": {"title": "Description", "type": "string", "minLength": 1, "example": "This post discusses stuff -- brief", "description": "A brief description of the post."}, "contentType": {"title": "Contenttype", "type": "string", "minLength": 1, "example": "text/markdown", "description": "The content type of the post. Must be one of 'text/markdown', 'text/plain', 'image/png;base64', 'image/jpeg;base64', or 'application/base64'."}, "content": {"title": "Content", "type": "string", "minLength": 1, "example": "This is my first post!", "description": "The content of the post."}, "author": {"$ref": "#/definitions/Author"}, "categories": {"type": "array", "items": {"type": "string", "minLength": 1}, "example": ["web", "tutorial"], "description": "A list of categories that the post belongs to."}, "published": {"title": "Published", "type": "string", "format": "date-time", "description": "The date and time that the post was published."}, "visibility": {"title": "Visibility", "type": "string", "minLength": 1, "example": "PUBLIC", "description": "The visibility of the post. Must be 'PUBLIC', or 'PRIVATE'."}, "unlisted": {"title": "Unlisted", "type": "boolean", "example": false, "description": "Whether the post is unlisted or not."}}}, "Posts": {"type": "object", "properties": {"type": {"title": "Type", "type": "string", "readOnly": true, "default": "posts", "minLength": 1}, "data": {"type": "array", "items": {"$ref": "#/definitions/Post"}, "readOnly": true}}}}}