feat: обновление API для поиска автомобиля по VIN - изменен маршрут на /v2/search, добавлены новые параметры и улучшены описания ответов для более информативного взаимодействия с пользователем

This commit is contained in:
Vlad 2025-04-21 01:26:42 +03:00
parent db80e6088b
commit 0643d8173a

View File

@ -77,10 +77,10 @@ paths:
type: string type: string
description: Error description description: Error description
/decode: /v2/search:
post: post:
summary: Decode VIN summary: Search vehicle by VIN (v2)
description: Decode VIN number to get vehicle information description: Search for vehicle information with full history records
parameters: parameters:
- name: access_code - name: access_code
in: query in: query
@ -101,83 +101,79 @@ paths:
example: "1HGCM82633A123456" example: "1HGCM82633A123456"
responses: responses:
'200': '200':
description: Successful decoding description: Successful search
content: content:
application/json: application/json:
schema: schema:
type: object type: object
properties: properties:
make: found:
type: string type: boolean
description: Vehicle make description: Whether the vehicle was found
model: details:
type: string type: object
description: Vehicle model description: Vehicle details
year: properties:
type: integer make:
description: Manufacturing year type: string
'400': description: Vehicle manufacturer
description: Invalid VIN or access code model:
content: type: string
application/json: description: Vehicle model
schema: year:
type: object type: integer
properties: description: Manufacturing year
error: body:
type: string type: string
description: Error description description: Vehicle body type
engine:
/detail/{vin}: type: string
get: description: Engine model
summary: Get detailed information cylinders:
description: Get detailed information about a vehicle by VIN type: string
parameters: description: Number of engine cylinders
- name: vin drive:
in: path type: string
required: true description: Drive type (FWD/RWD/AWD)
schema: records:
type: string
description: Vehicle Identification Number
- name: access_code
in: query
required: true
schema:
type: string
description: API access code for authentication
responses:
'200':
description: Successful information retrieval
content:
application/json:
schema:
type: object
properties:
vin:
type: string
description: VIN number
make:
type: string
description: Vehicle make
model:
type: string
description: Vehicle model
year:
type: integer
description: Manufacturing year
history:
type: array type: array
description: Vehicle history records
items: items:
type: object type: object
properties: properties:
date: odometer:
type: integer
description: Odometer reading in miles
odometer_status:
type: string
description: Odometer status (ACTUAL, EXEMPT, NOT ACTUAL)
title:
type: string
description: Title status (CLEAR, SALVAGE, REBUILT)
damage1:
type: string
description: Primary damage type
damage2:
type: string
description: Secondary damage type
add_to_db:
type: string type: string
format: date format: date
description: Event date description: Date added to database
event: RD_Status:
type: string type: string
description: Event description description: Vehicle status
'404': Sale_Location:
description: Vehicle not found type: string
description: Sale location
Repear_Cost:
type: number
description: Repair cost in USD
Photo_Count:
type: integer
description: Number of available photos
'400':
description: Invalid VIN or access code
content: content:
application/json: application/json:
schema: schema:
@ -275,4 +271,4 @@ paths:
properties: properties:
error: error:
type: string type: string
description: Error description description: Error description