Перейти к основному содержимому

OpenAPI Client:

Назначение

Опиши, какой API вызывает typed client, кто владеет контрактом и какие сценарии потребляют client.

Границы

ПолеЗначение
Consumer service/app<service-or-frontend-app>
Provider service<service-name/external-provider>
OpenAPI source<path/url>
Client package<package/project>
Base URL config<options class>
Auth scheme<scheme>

Операции

OperationIdMethodRouteRequest modelResponse model
<operationId><HTTP><route><RequestModel><ResponseModel>

Модель Request <RequestModel>

ПолеТипОбязательностьИсточникВалидация
<FieldName><Type>Да/Нет<source><rule>

Модель Response <ResponseModel>

ПолеТипОбязательностьПравила nullableMapping
<FieldName><Type>Да/Нет<when absent/null><internal model field>

Политика Resilience

АспектПравило
Timeout<duration>
Retry<retry count/backoff/retryable status>
Circuit breaker<threshold/duration>
Bulkhead/rate limit<rule>
Idempotency<header/key source>

Маппинг Ошибок

HTTP statusRemote errorLocal errorПовторяемость
<status><remote code><ErrorCode>Да/Нет

Безопасность

КонтрольПравило
Secrets<where stored, rotation, not logged>
Tenant propagation<TenantId header/claim/routing rule>
CorrelationX-Correlation-Id передается дальше.
Sensitive fields<masked/excluded>

Совместимость

Тип измененияПоведение client-а
Added optional field<ignored/mapped when known>
Removed field<breaking, requires version bump>
Unknown enum<fallback/controlled failure>
New status code<default typed remote error>

Проверка

ПроверкаИнструмент
Generated client compiles<command>
Contract test<command>
Error mapping test<command>
Resilience policy test<command>

Обратные ссылки

Автоссылки: где используется этот документ.