Skip to content

Instantly share code, notes, and snippets.

@sunmeat
Last active January 30, 2026 15:02
Show Gist options
  • Select an option

  • Save sunmeat/f705cf13c16d52dfc590d1e742cf1c7f to your computer and use it in GitHub Desktop.

Select an option

Save sunmeat/f705cf13c16d52dfc590d1e742cf1c7f to your computer and use it in GitHub Desktop.
приклад API-специфікації (scalar, не всі енд-поінти)
openapi: 3.1.0
info:
title: OLX NextGen API
description: |
API специфікація платформи **OLX NextGen**.
Документ підготовлений у стилі, сумісному з **Scalar API Docs**.
version: 1.0.0
servers:
- url: https://api.olx.ua/v1
description: Production
- url: https://staging-api.olx.ua/v1
description: Staging
security:
- BearerAuth: []
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
User:
type: object
properties:
id:
type: string
format: uuid
email:
type: string
format: email
role:
type: string
enum: [guest, user, business, moderator, admin]
Ad:
type: object
properties:
id:
type: string
format: uuid
title:
type: string
price:
type: number
currency:
type: string
category:
type: string
isPremium:
type: boolean
ErrorResponse:
type: object
properties:
code:
type: string
message:
type: string
paths:
/auth/register:
post:
summary: Реєстрація користувача
tags: [Auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
password:
type: string
responses:
'201':
description: Користувач створений
'400':
description: Помилка валідації
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/auth/login:
post:
summary: Вхід у систему
tags: [Auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
password:
type: string
responses:
'200':
description: Успішна автентифікація
/ads:
get:
summary: Пошук оголошень
tags: [Ads]
parameters:
- name: q
in: query
schema:
type: string
- name: priceFrom
in: query
schema:
type: number
- name: priceTo
in: query
schema:
type: number
responses:
'200':
description: Список оголошень
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Ad'
post:
summary: Створення оголошення
tags: [Ads]
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Ad'
responses:
'201':
description: Оголошення створено
/payments/premium:
post:
summary: Покупка преміум-послуг
tags: [Payments]
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
adId:
type: string
type:
type: string
enum: [boost, highlight, top]
responses:
'200':
description: Платіж ініційовано
/recommendations:
get:
summary: AI-рекомендації для користувача
tags: [Recommendations]
security:
- BearerAuth: []
responses:
'200':
description: Персоналізовані рекомендації
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Ad'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment