openapi: 3.0.0 info: title: api version: '1.0' servers: - url: 'http://localhost:8000' paths: /posts/add: post: summary: Add Post tags: - posts responses: '200': description: OK operationId: get-posts parameters: [] requestBody: content: application/json: schema: type: object properties: title: type: string content: type: string language: type: string images: type: array items: type: object properties: img_name: type: string id: type: integer tags: type: array items: type: object properties: name: type: string id: type: number required: - name category: type: object properties: name: type: string id: type: number required: - name date: type: string format: date locations: type: array items: type: object properties: latitude: type: number format: float longitude: type: number format: float name: type: string id: type: number required: - title - content description: |- Make sure to send data as `application/json`. Images, tags, categories, and locations can optionally be identified by an `id` integer if it is already known. That is, if you are adding a Post with a category that already exists, you may use that category's `id` to identify it. Otherwise, disregard the id parameter. Images in the `images` array must be those that already exist. If you want to create a new post and also upload new images, you must first send a separate request to add a new image. The response to this request will include the identifying `id` or `img_name`, which you can then use to create a post linked to those images. description: '' parameters: [] /tags: get: summary: Get Tags tags: - tags responses: '200': description: OK content: application/json: schema: type: object properties: name: type: string id: type: integer examples: {} application/xml: schema: type: array items: type: string operationId: get-tags description: Obtain a list of tags /categories: get: summary: Get Categories tags: - categories responses: '200': description: OK content: application/json: schema: type: object properties: id: type: integer name: type: string application/xml: schema: type: array items: type: string operationId: get-categories description: Obtain a list of categories /tags/add: post: summary: Add Tag operationId: post-tags-add responses: '200': description: OK description: '' tags: - tags requestBody: content: application/json: schema: type: object properties: name: type: string required: - name '/posts/{post_id}/update': patch: summary: Update Post by ID operationId: patch-posts-post_id-update responses: '200': description: OK content: application/json: schema: type: object description: '' tags: - posts requestBody: content: application/json: schema: type: object properties: title: type: string content: type: string language: type: string images: type: array items: type: object properties: img_name: type: string id: type: integer tags: type: array items: type: object properties: name: type: string id: type: number category: type: object properties: name: type: string id: type: number date: type: string format: date locations: type: object properties: latitude: type: number longitude: type: number name: type: string id: type: number parameters: - schema: type: string name: post_id in: path required: true '/posts/{post_id}/delete': parameters: - schema: type: string name: post_id in: path required: true delete: summary: Delete Post by ID operationId: delete-posts-post_id-delete responses: '200': description: OK tags: - posts '/tags/{tag_id}/delete': parameters: - schema: type: string name: tag_id in: path required: true delete: summary: Delete Tag by ID operationId: delete-tags-tag_id-delete responses: '200': description: OK tags: - tags '/categories/{category_id}/delete': parameters: - schema: type: string name: category_id in: path required: true delete: summary: Delete Category by ID operationId: delete-categories-category_id-delete responses: '200': description: OK tags: - categories /categories/add: post: summary: Add Category operationId: post-categories-add responses: '200': description: OK requestBody: content: application/json: schema: type: object properties: name: type: string required: - name tags: - categories '/categories/{category_id}/update': parameters: - schema: type: string name: category_id in: path required: true patch: summary: Update Category by ID operationId: patch-categories-category_id-update responses: '200': description: OK requestBody: content: application/json: schema: type: object properties: name: type: string required: - name description: '' tags: - categories /posts: get: summary: Get Posts tags: - posts responses: {} operationId: get-posts requestBody: content: application/json: schema: type: object properties: title: type: string content: type: string language: type: string images: type: array items: type: object properties: id: type: number img_name: type: string img_file: type: string tags: type: array items: type: object properties: name: type: string id: type: number category: type: object properties: name: type: string id: type: number date: type: string format: date locations: type: object properties: latitude: type: number longitude: type: number name: type: string id: type: number id: type: integer description: '' parameters: - schema: type: integer in: query name: post_id description: 'returns a single post that matches this ID, if any' - schema: type: integer in: query name: tag_id description: returns posts that have a tag with this ID - schema: type: integer in: query name: category_id description: returns posts that have the category with this ID - schema: type: string in: query name: keyword description: 'returns posts that contain this keyword in the title, category, any of its tags, or the body text (case-insensitive)' '/tags/{tag_id}/update': parameters: - schema: type: string name: tag_id in: path required: true patch: summary: Update Tag by ID operationId: patch-tags-tag_id-update responses: '200': description: OK requestBody: content: application/json: schema: type: object properties: name: type: string required: - name tags: - tags /images/add: post: summary: Add Image operationId: post-images-add responses: '200': description: OK tags: - images requestBody: content: multipart/form-data: schema: type: object properties: img_file: type: string format: byte img_name: type: string required: - img_file description: Make sure to send data as `multipart/form-data`. '/images/{image_id}/delete': parameters: - schema: type: string name: image_id in: path required: true delete: summary: Delete Image operationId: delete-images-image_id-delete responses: '200': description: OK tags: - images /locations: get: summary: Get Locations tags: - locations responses: {} operationId: get-locations requestBody: content: application/json: schema: type: array items: type: object properties: id: type: string longitude: type: number format: float latitude: type: number format: float name: type: string /locations/add: post: summary: Add Location operationId: post-locations-add responses: '200': description: OK requestBody: content: application/json: schema: type: object properties: latitude: type: number format: float longitude: type: number format: float name: type: string required: - latitude - longitude tags: - locations '/locations/{location_id}/update': parameters: - schema: type: string name: location_id in: path required: true patch: summary: Update Location by ID operationId: patch-locations-location_id-update responses: '200': description: OK tags: - locations requestBody: content: application/json: schema: type: object properties: latitude: type: number format: float longitude: type: number format: float name: type: string '/locations/{location_id}/delete': parameters: - schema: type: string name: location_id in: path required: true delete: summary: Delete Location by ID operationId: delete-locations-location_id-delete responses: '200': description: OK tags: - locations /pdfs/add: post: summary: Add Pdf operationId: post-pdfs-add responses: '200': description: OK description: Add a PDF file requestBody: content: application/json: schema: type: object properties: pdf_file: type: string multipart/form-data: schema: type: object properties: pdf_file: type: string description: Make sure to send data as `multipart/form-data`. '/pdfs/{pdf_id}/delete': parameters: - schema: type: string name: pdf_id in: path required: true delete: summary: Delete Pdf operationId: delete-pdfs-pdf_id-delete responses: '200': description: OK description: Delete a PDF file components: schemas: {} tags: - name: tags - name: posts - name: categories - name: images - name: locations