diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 03e843dcd..94bae843d 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -10,6 +10,16 @@ sources: - location: ./sdks/schemas/error-types.yaml registry: location: registry.speakeasyapi.dev/hookdeck-dev/outpost/outpost-api + Outpost API (Go): + inputs: + - location: ./docs/apis/openapi.yaml + overlays: + - location: ./sdks/schemas/speakeasy-modifications-overlay.yaml + - location: ./sdks/schemas/security-collapse-overlay.yaml + - location: ./sdks/schemas/error-types.yaml + - location: ./sdks/schemas/go-array-params-overlay.yaml + registry: + location: registry.speakeasyapi.dev/hookdeck-dev/outpost/outpost-api Outpost API (Python): inputs: - location: ./docs/apis/openapi.yaml @@ -23,7 +33,7 @@ sources: targets: outpost-go: target: go - source: Outpost API + source: Outpost API (Go) output: ./sdks/outpost-go codeSamples: registry: diff --git a/sdks/schemas/go-array-params-overlay.yaml b/sdks/schemas/go-array-params-overlay.yaml new file mode 100644 index 000000000..33eeccd1f --- /dev/null +++ b/sdks/schemas/go-array-params-overlay.yaml @@ -0,0 +1,144 @@ +overlay: 1.0.0 +x-speakeasy-jsonpath: rfc9535 +info: + title: Go Array Query Params + version: 0.0.1 + x-speakeasy-metadata: + type: go-array-params + description: "Replace oneOf [string, array] query params with plain arrays for cleaner Go SDK types" +extends: ../../docs/apis/openapi.yaml +actions: + # GET /tenants: id + - target: $["paths"]["/tenants"]["get"]["parameters"][?@.name == 'id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants"]["get"]["parameters"][?@.name == 'id']["schema"] + update: + type: array + items: + type: string + + # GET /events: id, tenant_id, topic + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'id']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'tenant_id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'tenant_id']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'topic']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'topic']["schema"] + update: + type: array + items: + type: string + + # GET /attempts: tenant_id, event_id, destination_id, topic, include + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'tenant_id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'tenant_id']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'event_id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'event_id']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'destination_id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'destination_id']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'topic']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'topic']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'include']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'include']["schema"] + update: + type: array + items: + type: string + + # GET /attempts/{attempt_id}: include + - target: $["paths"]["/attempts/{attempt_id}"]["get"]["parameters"][?@.name == 'include']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/attempts/{attempt_id}"]["get"]["parameters"][?@.name == 'include']["schema"] + update: + type: array + items: + type: string + + # GET /tenants/{tenant_id}/destinations: type (DestinationType), topics + - target: $["paths"]["/tenants/{tenant_id}/destinations"]["get"]["parameters"][?@.name == 'type']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants/{tenant_id}/destinations"]["get"]["parameters"][?@.name == 'type']["schema"] + update: + type: array + items: + $ref: "#/components/schemas/DestinationType" + + - target: $["paths"]["/tenants/{tenant_id}/destinations"]["get"]["parameters"][?@.name == 'topics']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants/{tenant_id}/destinations"]["get"]["parameters"][?@.name == 'topics']["schema"] + update: + type: array + items: + type: string + + # GET /tenants/{tenant_id}/destinations/{destination_id}/attempts: event_id, topic, include + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'event_id']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'event_id']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'topic']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'topic']["schema"] + update: + type: array + items: + type: string + + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'include']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'include']["schema"] + update: + type: array + items: + type: string + + # GET /tenants/{tenant_id}/destinations/{destination_id}/attempts/{attempt_id}: include + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts/{attempt_id}"]["get"]["parameters"][?@.name == 'include']["schema"]["oneOf"] + remove: true + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts/{attempt_id}"]["get"]["parameters"][?@.name == 'include']["schema"] + update: + type: array + items: + type: string diff --git a/sdks/schemas/pagination-fixes-overlay.yaml b/sdks/schemas/pagination-fixes-overlay.yaml index 12fa55640..ee8b68c13 100644 --- a/sdks/schemas/pagination-fixes-overlay.yaml +++ b/sdks/schemas/pagination-fixes-overlay.yaml @@ -2,10 +2,10 @@ overlay: 1.0.0 x-speakeasy-jsonpath: rfc9535 info: title: Pagination Field Fixes - version: 0.0.2 + version: 0.0.3 x-speakeasy-metadata: type: pagination-fixes - description: "Fixes pagination field conflicts with Python built-ins; v0.13 uses SeekPagination and models/pagination envelope" + description: "Fixes pagination field conflicts with Python built-ins; uses filter expressions instead of positional indices for resilience to parameter reordering" extends: ../../docs/apis/openapi.yaml actions: # Fix 'next' field in SeekPagination to avoid Python built-in next() conflict @@ -24,89 +24,87 @@ actions: type: field-name-override description: "Rename 'prev' to 'prev_cursor' for consistency" - # Rename query param 'dir' (sort direction) to 'direction' to avoid Python builtin shadowing (W0622) - - target: $["paths"]["/tenants"]["get"]["parameters"][2] + # Rename query param 'dir' to 'direction' to avoid Python builtin shadowing (W0622) + # Uses filter expressions to target by name — immune to parameter reordering + - target: $["paths"]["/tenants"]["get"]["parameters"][?@.name == 'dir'] update: x-speakeasy-name-override: "direction" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'dir' to 'direction' (sort direction) to avoid shadowing builtin dir()" - - target: $["paths"]["/events"]["get"]["parameters"][8] + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'dir'] update: x-speakeasy-name-override: "direction" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'dir' to 'direction' (sort direction)" - - target: $["paths"]["/attempts"]["get"]["parameters"][12] + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'dir'] update: x-speakeasy-name-override: "direction" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'dir' to 'direction' (sort direction)" - - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][10] + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'dir'] update: x-speakeasy-name-override: "direction" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'dir' to 'direction' (sort direction)" - # GET /tenants: parameters limit=0, order_by=1, dir=2, created_at[gte]=3, created_at[lte]=4, next=5, prev=6 - - target: $["paths"]["/tenants"]["get"]["parameters"][5] + # Rename 'next'/'prev' query params to 'next_cursor'/'prev_cursor' + - target: $["paths"]["/tenants"]["get"]["parameters"][?@.name == 'next'] update: x-speakeasy-name-override: "next_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'next' query parameter to 'next_cursor'" - - target: $["paths"]["/tenants"]["get"]["parameters"][6] + - target: $["paths"]["/tenants"]["get"]["parameters"][?@.name == 'prev'] update: x-speakeasy-name-override: "prev_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'prev' query parameter to 'prev_cursor'" - # GET /events: tenant_id=0, topic=1, time[gte]=2, time[lte]=3, limit=4, next=5, prev=6 (destination_id removed in v0.13) - - target: $["paths"]["/events"]["get"]["parameters"][5] + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'next'] update: x-speakeasy-name-override: "next_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'next' query parameter to 'next_cursor'" - - target: $["paths"]["/events"]["get"]["parameters"][6] + - target: $["paths"]["/events"]["get"]["parameters"][?@.name == 'prev'] update: x-speakeasy-name-override: "prev_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'prev' query parameter to 'prev_cursor'" - # GET /attempts: next=8, prev=9 - - target: $["paths"]["/attempts"]["get"]["parameters"][8] + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'next'] update: x-speakeasy-name-override: "next_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'next' query parameter to 'next_cursor'" - - target: $["paths"]["/attempts"]["get"]["parameters"][9] + - target: $["paths"]["/attempts"]["get"]["parameters"][?@.name == 'prev'] update: x-speakeasy-name-override: "prev_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'prev' query parameter to 'prev_cursor'" - # GET /tenants/{tenant_id}/destinations/{destination_id}/attempts: next=6, prev=7 - - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][6] + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'next'] update: x-speakeasy-name-override: "next_cursor" x-speakeasy-metadata: type: parameter-name-override description: "Rename 'next' query parameter to 'next_cursor'" - - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][7] + - target: $["paths"]["/tenants/{tenant_id}/destinations/{destination_id}/attempts"]["get"]["parameters"][?@.name == 'prev'] update: x-speakeasy-name-override: "prev_cursor" x-speakeasy-metadata: