一键导入
overlay-guide
Reference guide for creating and modifying OpenAPI Overlays used to customize the Attio API spec before SDK generation with Speakeasy
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reference guide for creating and modifying OpenAPI Overlays used to customize the Attio API spec before SDK generation with Speakeasy
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | overlay-guide |
| description | Reference guide for creating and modifying OpenAPI Overlays used to customize the Attio API spec before SDK generation with Speakeasy |
| disable-model-invocation | true |
| allowed-tools | Read, Grep, Glob, Bash |
Reference for creating and using OpenAPI Overlays to customize the API specification without modifying the original OpenAPI document. Overlays follow the OpenAPI Overlay Specification v1.0.0.
Every overlay document contains three required sections:
overlay: 1.0.0 # Overlay specification version
info: # Metadata about the overlay
title: "Description"
version: "0.0.1"
actions: # Array of modifications to apply
- target: "JSONPath"
update: {}
Each action contains:
| Expression | Description |
|---|---|
$.info.title | Select the title field of the info object |
$.servers[0].url | Select the URL of the first server |
$.paths['/drinks'].get | Select the GET operation on /drinks path |
$.paths.*.* | Select all operations across all paths |
$.paths..parameters[?(@.in=='query')] | Select all query parameters |
$.components.schemas.Drink | Select the Drink schema |
$.paths.*[?(@.operationId == 'listUsers')] | Select operations by operationId |
| Update Type | Target Object |
|---|---|
| Update primitive value (string, number, boolean) | The containing object |
| Update an object | The object itself |
| Update an array | The array itself |
| Add new property to object | The object itself |
| Remove property/item | The object/array itself |
actions:
- target: $.paths.*.*[?(@.operationId == 'generateCodeSamplePreviewAsync')]
update:
x-speakeasy-name-override: generateCodeSamplePreviewAsynchronous
actions:
- target: $["paths"]["/v1/artifacts/namespaces"]["get"]
update:
x-codeSamples:
- lang: python
label: getNamespaces
source: |-
from sdk import Client
client = Client(api_key="<KEY>")
res = client.artifacts.get_namespaces()
actions:
- target: "$.paths['/internal/staff']"
update:
x-internal: true
Remove operation-level server and security configs to use global defaults:
actions:
- target: $.paths.*.*.servers
remove: true
- target: $.paths.*.*.security
remove: true
actions:
- target: "$.components.schemas.Order"
update:
x-speakeasy-entity: Order
actions:
- target: "$.components.schemas.Drink"
update:
properties:
type:
type: string
description: "Type of drink, e.g., 'cocktail', 'beer'."
x-speakeasy-name-override: Override generated method/class namesx-speakeasy-entity: Enable Terraform provider supportx-speakeasy-entity-operation: Mark operations for entity supportx-internal: Hide endpoints from public SDK generationx-codeSamples: Add language-specific code examplesx-speakeasy-retries: Configure retry behaviorx-speakeasy-pagination: Configure pagination handling# Compare two specs to generate an overlay
speakeasy overlay compare --before=./openapi_original.yaml --after=./openapi.yaml > overlay.yaml
# Validate an overlay
speakeasy overlay validate -o overlay.yaml
# Apply an overlay to produce a combined spec
speakeasy overlay apply -s openapi.yaml -o overlay.yaml > combined.yaml
# Add overlay to Speakeasy workflow
speakeasy configure sources
The overlay file is at overlay.yaml in the project root. It currently handles:
format fields and changes examples/descriptions so Speakeasy generates str instead of date typeslist parameter renaming: Renames list to list_id via x-speakeasy-name-override to avoid Python built-in conflictsThe overlay is referenced in .speakeasy/workflow.yaml and applied automatically during speakeasy run.
speakeasy overlay validatetarget points to the correct location and format follows the speconeOf index drift: The indices in overlay.yaml are positional — if Attio reorders schema union types, update the index numbers