From 533eeb4fcd6e3abfa56be825dba51016878fb00b Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Fri, 19 Dec 2025 02:18:10 +0530 Subject: [PATCH] fix: Update config endpoint response schemas to match actual API behavior The config endpoints were documented with a {success, data} wrapper format, but the actual API returns flat objects: - POST /configs: Returns {id, version_id, slug, object} not {success, data: {id, version_id}} - GET /configs: Returns {object, total, data: [...]} not {success, data: [...]} - GET /configs/{slug}: Returns flat object with all fields, not {success, data: {config: ...}} This fix aligns the OpenAPI spec with the actual API responses, which is required for accurate SDK and Terraform provider code generation. --- openapi.yaml | 167 ++++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 82 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index cf09826f..63d964fa 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9832,8 +9832,13 @@ paths: schema: type: object properties: - success: - type: boolean + object: + type: string + description: Object type identifier + example: list + total: + type: integer + description: Total number of configs data: type: array items: @@ -9868,6 +9873,9 @@ paths: last_updated_at: type: string format: date-time + object: + type: string + example: config examples: example-1: value: @@ -9990,27 +9998,29 @@ paths: schema: type: object properties: - success: - type: boolean - data: - type: object - properties: - id: - type: string - format: uuid - version_id: - type: string - format: uuid + id: + type: string + format: uuid + description: Unique identifier for the config + version_id: + type: string + format: uuid + description: Version identifier for the config + slug: + type: string + description: URL-friendly identifier for the config + object: + type: string + description: Object type identifier + example: config examples: example-1: value: { - "success": true, - "data": - { - "id": "f3d8d070-f29d-43a3-bf97-3159c60f4ce0", - "version_id": "0db4065b-ead2-4daa-bf5e-7e9106585133", - }, + "id": "f3d8d070-f29d-43a3-bf97-3159c60f4ce0", + "version_id": "0db4065b-ead2-4daa-bf5e-7e9106585133", + "slug": "pc-my-config-abc123", + "object": "config" } x-code-samples: - lang: python @@ -10204,73 +10214,66 @@ paths: schema: type: object properties: - success: - type: boolean - data: - type: object - properties: - config: - type: object - properties: - retry: - type: object - properties: - attempts: - type: integer - on_status_codes: - type: array - items: - type: integer - cache: - type: object - properties: - mode: - type: string - max_age: - type: integer - strategy: - type: object - properties: - mode: - type: string - targets: - type: array - items: - type: object - properties: - provider: - type: string - virtual_key: - type: string + id: + type: string + format: uuid + name: + type: string + slug: + type: string + organisation_id: + type: string + format: uuid + workspace_id: + type: string + format: uuid + is_default: + type: integer + status: + type: string + owner_id: + type: string + format: uuid + updated_by: + type: string + format: uuid + created_at: + type: string + format: date-time + last_updated_at: + type: string + format: date-time + version_id: + type: string + format: uuid + format: + type: string + type: + type: string + object: + type: string + example: config + config: + type: string + description: JSON string containing the config object examples: example-1: value: { - "success": true, - "data": - { - "config": - { - "retry": - { - "attempts": 5, - "on_status_codes": [429, 529], - }, - "cache": { "mode": "simple", "max_age": 3600 }, - "strategy": { "mode": "fallback" }, - "targets": - [ - { - "provider": "openai", - "virtual_key": "main-258f4d", - }, - { - "provider": "azure-openai", - "virtual_key": "azure-test-4110dd", - }, - ], - }, - }, + "id": "f3d8d070-f29d-43a3-bf97-3159c60f4ce0", + "name": "My Config", + "slug": "pc-my-config-abc123", + "organisation_id": "c34223e8-d419-4ee6-8f46-f7f5675da424", + "workspace_id": "878632ce-4ac0-451e-8ed4-0703f3944a07", + "is_default": 0, + "status": "active", + "created_at": "2025-01-01T00:00:00.000Z", + "last_updated_at": "2025-01-01T00:00:00.000Z", + "version_id": "0db4065b-ead2-4daa-bf5e-7e9106585133", + "format": "json", + "type": "ORG_CONFIG", + "object": "config", + "config": "{\"strategy\":{\"mode\":\"single\"},\"targets\":[{\"provider\":\"openai\"}]}" } x-code-samples: - lang: python