openapi: "3.0.3" info: title: AdoptMe API version: "1.0" description: This AdoptMe API documentation is a comprehensive guide designed to bridge the gap between frontend and backend teams. With clear and structured documentation, team members can easily understand how to interact with the API and build exciting features for our pet adoption platform. contact: name: Fadhil Gani # url: https://yourwebsite.com email: fadhilgani2@gmail.com servers: - url: https://adoptme-be.vercel.app/ - url: http://localhost:3000 tags: - name: pets description: Operations about pets - name: etc description: etcetera paths: /api/pets: get: tags: - pets summary: Get catalog of pets description: Returns a list of pets with pagination and optional species filter. parameters: - name: x-api-key in: header description: API key for authorization required: true schema: type: string - name: page in: query description: Page number (minimum 1) required: false schema: type: integer default: 1 minimum: 1 - name: species in: query description: Filter by species name required: false schema: type: string responses: "200": description: A list of pets content: application/json: schema: type: object properties: data: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: Oyen location: type: string example: Garut favoriteCount: type: integer example: 100 petPhotos: type: array items: type: string example: "https://example.com/image.jpg" createdAt: type: string format: date-time example: 2021-08-01T12:00:00Z meta: type: object properties: total: type: integer example: 100 perPage: type: integer example: 10 currentPage: type: integer example: 1 totalPages: type: integer example: 10 links: type: object properties: first: type: string example: "/api/pets?page=1" last: type: string example: "/api/pets?page=10" prev: type: string nullable: true example: null next: type: string example: "/api/pets?page=2" "400": description: Invalid request parameters content: application/json: schema: type: object properties: error: type: string example: Invalid request parameters "403": description: "Forbidden: Invalid API key" content: application/json: schema: type: object properties: error: type: string example: "Forbidden: Invalid API key" "500": description: Internal server error content: application/json: schema: type: object properties: error: type: string example: Internal server error /api/pet/{id}: get: tags: - pets summary: Get pet by ID description: Returns a single pet by ID. parameters: - name: x-api-key in: header description: API key for authorization required: true schema: type: string - name: id in: path description: ID of the pet to get required: true schema: type: integer responses: "200": description: A specific pet content: application/json: schema: type: object properties: id: type: integer example: 1 name: type: string example: Oyen description: type: string example: "Friendly and playful" weight: type: integer example: 20 species: type: string example: Cat breed: type: string example: Persian age: type: integer example: 2 gender: type: string example: Female healthCondition: type: string example: Healthy location: type: string example: New York userId: type: integer example: 1 userName: type: string example: John Doe userPhone: type: string example: "+621234567890" userEmail: type: string example: "example@gmail.com" userPhoto: type: string example: "https://example.com/user.jpg" createdAt: type: string format: date-time example: 2021-08-01T12:00:00Z updatedAt: type: string format: date-time example: 2021-08-01T12:00:00Z petPhotos: type: array items: type: object properties: id: type: integer example: 1 url: type: string example: "https://example.com/photo.jpg" "404": description: pet not found content: application/json: schema: type: object properties: error: type: string example: pet not found "500": description: Internal server error content: application/json: schema: type: object properties: error: type: string example: Internal server error /api/random-facts: get: tags: - etc summary: Get a random fact about dogs or cats description: Returns a random fact about dogs or cats, translated to Indonesian. responses: "200": description: A random fact about dogs or cats content: application/json: schema: type: object properties: type: type: string example: dog fact: type: string example: "Anjing memiliki indera penciuman yang sangat tajam." "500": description: Internal server error content: application/json: schema: type: object properties: error: type: string example: Internal server error