Files
satusehat-service/docs/api/openapi.yaml
T
2026-04-14 01:23:34 +00:00

150 lines
3.6 KiB
YAML

openapi: 3.0.0
info:
title: Person Service API
description: REST API for Person Management Service
version: 1.0.0
contact:
name: API Support
email: [email protected]
servers:
- url: http://localhost:8080/api/v1
description: Development server
paths:
/persons:
get:
summary: Get list of persons
description: Retrieve paginated list of persons
parameters:
- name: page
in: query
description: Page number
required: false
schema:
type: integer
default: 1
- name: limit
in: query
description: Items per page
required: false
schema:
type: integer
default: 10
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedPersonResponse'
post:
summary: Create new person
description: Create a new person record
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePersonRequest'
responses:
'201':
description: Person created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/PersonResponse'
/persons/{id}:
get:
summary: Get person detail
description: Retrieve detailed information about a specific person
parameters:
- name: id
in: path
required: true
description: Person ID
schema:
type: integer
format: int64
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PersonResponse'
'404':
description: Person not found
put:
summary: Update person
description: Update an existing person record
parameters:
- name: id
in: path
required: true
description: Person ID
schema:
type: integer
format: int64
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePersonRequest'
responses:
'200':
description: Person updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/PersonResponse'
'404':
description: Person not found
components:
schemas:
CreatePersonRequest:
type: object
properties:
name:
type: string
email:
type: string
format: email
phone:
type: string
required:
- name
- email
PersonResponse:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
email:
type: string
phone:
type: string
created_at:
type: string
format: date-time
PaginatedPersonResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/PersonResponse'
meta:
type: object
properties:
page:
type: integer
limit:
type: integer
total:
type: integer
total_pages:
type: integer