gohorsejobs/backend/docs/swagger.yaml
2025-12-14 16:40:29 -03:00

347 lines
7.4 KiB
YAML

basePath: /
definitions:
dto.CreateJobRequest:
properties:
benefits:
additionalProperties: true
type: object
cityId:
type: integer
companyId:
type: integer
description:
minLength: 20
type: string
employmentType:
enum:
- full-time
- part-time
- dispatch
- contract
type: string
languageLevel:
type: string
location:
type: string
regionId:
type: integer
requirements:
additionalProperties: true
type: object
salaryMax:
type: number
salaryMin:
type: number
salaryType:
enum:
- hourly
- monthly
- yearly
type: string
status:
enum:
- draft
- open
- closed
type: string
title:
maxLength: 255
minLength: 5
type: string
visaSupport:
type: boolean
workingHours:
type: string
required:
- companyId
- description
- title
type: object
dto.PaginatedResponse:
properties:
data: {}
pagination:
$ref: '#/definitions/dto.Pagination'
type: object
dto.Pagination:
properties:
limit:
type: integer
page:
type: integer
total:
type: integer
type: object
dto.UpdateJobRequest:
properties:
benefits:
additionalProperties: true
type: object
cityId:
type: integer
description:
minLength: 20
type: string
employmentType:
enum:
- full-time
- part-time
- dispatch
- contract
type: string
languageLevel:
type: string
location:
type: string
regionId:
type: integer
requirements:
additionalProperties: true
type: object
salaryMax:
type: number
salaryMin:
type: number
salaryType:
enum:
- hourly
- monthly
- yearly
type: string
status:
enum:
- draft
- open
- closed
type: string
title:
maxLength: 255
minLength: 5
type: string
visaSupport:
type: boolean
workingHours:
type: string
type: object
models.JSONMap:
additionalProperties: true
type: object
models.Job:
properties:
benefits:
$ref: '#/definitions/models.JSONMap'
cityId:
type: integer
companyId:
type: integer
createdAt:
description: Metadata
type: string
createdBy:
type: integer
description:
type: string
employmentType:
description: Employment
type: string
id:
type: integer
isFeatured:
description: Featured job flag
type: boolean
languageLevel:
description: N5-N1, beginner, none
type: string
location:
description: Location
type: string
regionId:
type: integer
requirements:
allOf:
- $ref: '#/definitions/models.JSONMap'
description: Requirements & Benefits (JSONB arrays)
salaryMax:
type: number
salaryMin:
description: Salary
type: number
salaryType:
description: hourly, monthly, yearly
type: string
status:
description: Status
type: string
title:
description: Job Details
type: string
updatedAt:
type: string
visaSupport:
description: Visa & Language
type: boolean
workingHours:
type: string
type: object
host: localhost:8080
info:
contact: {}
description: API for GoHorseJobs recruitment platform.
title: GoHorseJobs API
version: "1.0"
paths:
/jobs:
get:
consumes:
- application/json
description: Get a paginated list of job postings with optional filters
parameters:
- description: 'Page number (default: 1)'
in: query
name: page
type: integer
- description: 'Items per page (default: 10, max: 100)'
in: query
name: limit
type: integer
- description: Filter by company ID
in: query
name: companyId
type: integer
- description: Filter by featured status
in: query
name: featured
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.PaginatedResponse'
"500":
description: Internal Server Error
schema:
type: string
summary: List all jobs
tags:
- Jobs
post:
consumes:
- application/json
description: Create a new job posting
parameters:
- description: Job data
in: body
name: job
required: true
schema:
$ref: '#/definitions/dto.CreateJobRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/models.Job'
"400":
description: Bad Request
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
summary: Create a new job
tags:
- Jobs
/jobs/{id}:
delete:
consumes:
- application/json
description: Delete a job posting
parameters:
- description: Job ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
summary: Delete a job
tags:
- Jobs
get:
consumes:
- application/json
description: Get a single job posting by its ID
parameters:
- description: Job ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Job'
"400":
description: Bad Request
schema:
type: string
"404":
description: Not Found
schema:
type: string
summary: Get job by ID
tags:
- Jobs
put:
consumes:
- application/json
description: Update an existing job posting
parameters:
- description: Job ID
in: path
name: id
required: true
type: integer
- description: Updated job data
in: body
name: job
required: true
schema:
$ref: '#/definitions/dto.UpdateJobRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Job'
"400":
description: Bad Request
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
summary: Update a job
tags:
- Jobs
swagger: "2.0"