openapi: 3.0.0 info: title: PANTS-API version: '1.0' description: API for interacting with all components of PANTS contact: name: Austin license: name: MIT servers: - url: 'http://localhost:8000/api/v1.0' paths: /ingredients: get: summary: Get all ingredients tags: - Ingredients responses: '200': description: OK content: application/json: schema: allOf: - $ref: '#/components/schemas/Response-Meta' - $ref: '#/components/schemas/Response-Paging' - type: object properties: data: type: - string - array items: $ref: '#/components/schemas/Ingredient' operationId: get-ingredients description: Gets a collection of all ingredients on the server post: summary: Create an Ingredient operationId: post-ingredients responses: '200': description: OK content: application/json: schema: allOf: - $ref: '#/components/schemas/Response-Meta' - type: object properties: data: $ref: '#/components/schemas/Ingredient' '400': description: Bad Request - Either the request was malformed or was missing required information content: application/json: schema: $ref: '#/components/schemas/Response-Meta' description: Creates an ingredient and automatically assigns it an ID tags: - Ingredients '/ingredients/{ingredient_id}': parameters: - schema: type: string name: ingredient_id in: path required: true get: summary: Get Ingredient by ID tags: - Ingredients responses: '200': description: OK content: application/json: schema: allOf: - $ref: '#/components/schemas/Response-Meta' - type: object properties: data: $ref: '#/components/schemas/Ingredient' examples: {} '404': description: Not Found - The Ingredient you are attempting to get does not exist. content: application/json: schema: $ref: '#/components/schemas/Response-Meta' operationId: get-ingredients-ingredient_id description: "Gets a single ingredient based on it's ID number" post: summary: Update Ingredient by ID operationId: post-ingredients-ingredient_id responses: '200': description: OK content: application/json: schema: allOf: - $ref: '#/components/schemas/Response-Meta' - type: object properties: data: $ref: '#/components/schemas/Ingredient' '400': description: 'Bad Request - Either your request is missing required keys, or certain values you have requested are invalid.' content: application/json: schema: $ref: '#/components/schemas/Response-Meta' '404': description: Not Found - The Ingredient you are attempting to update does not exist. content: application/json: schema: $ref: '#/components/schemas/Response-Meta' description: Updates the specified ingredient with given ID so that a subsequent GET request would return the provided information. requestBody: content: application/json: schema: $ref: '#/components/schemas/Ingredient' description: The ingredient information you wish to overwrite onto the existing ingredient. tags: - Ingredients delete: summary: Delete Ingredient by ID operationId: delete-ingredients-ingredient_id responses: '200': description: OK content: application/json: schema: allOf: - $ref: '#/components/schemas/Response-Meta' - type: object properties: data: $ref: '#/components/schemas/Response-Meta' description: The deleted Ingredient '404': description: Not Found - The specific Ingredient you requested to delete does not exist. Either it was already deleted or it never existed in the first place. content: application/json: schema: $ref: '#/components/schemas/Response-Meta' description: Removes an Ingredient from the system. Subsequent requests to GET this Ingredient will return 404 until an Ingredient is created with this same ID again. tags: - Ingredients components: schemas: Ingredient: title: Ingredient type: object description: 'A component of recipies. Should be a generic descriptor, without specific brand or product information.' properties: id: type: string name: type: string slug: type: string description: type: string tags: type: array items: $ref: '#/components/schemas/Tag' serving: type: number x-tags: - Ingredients Tag: title: Tag type: object properties: id: type: string verbose_name_plural: type: string name: type: string description: type: string description: A descriptor for helping group together similar Ingredients x-tags: - Ingredients Response-Paging: title: Request-Paging type: object description: A model used to keep paging information so that all endpoints use the same paging format. properties: count_all_results: type: number next: type: string previous: type: string count_page_results: type: number x-tags: - Responses Response-Meta: title: Response-Meta type: object description: Response keys providing information about the state and status of a response. properties: success: type: boolean message: type: string description: 'A verbose description of the actions the server took, or of the error that caused the action to not take place.' x-tags: - Responses securitySchemes: {}