원클릭으로
extract-rest-schema
Extract schemas from REST API endpoints by fetching sample responses and inferring data structure
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Extract schemas from REST API endpoints by fetching sample responses and inferring data structure
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | extract-rest-schema |
| description | Extract schemas from REST API endpoints by fetching sample responses and inferring data structure |
Extracts Starlake table schemas from REST API endpoints. Fetches a sample response from each configured endpoint, infers the JSON structure, and generates Starlake YAML configuration files (domain + table definitions). Supports nested objects, arrays, parent-child endpoint relationships, and automatic type inference (string, long, decimal, boolean, date, timestamp, struct).
starlake extract-rest-schema [options]
--config <value>: REST API extraction config name (required): references a file in metadata/extract/--outputDir <value>: Where to output YAML schema files--connectionRef <value>: Connection reference name--reportFormat <value>: Report output format: console, json, or html# metadata/extract/my-rest-api.sl.yml
version: 1
extract:
restAPI:
baseUrl: "https://api.example.com/v2"
auth:
type: bearer
token: "{{API_TOKEN}}"
endpoints:
- path: "/customers"
as: "customer"
domain: "crm"
responsePath: "$.data"
- path: "/orders"
as: "order"
domain: "crm"
pagination:
type: cursor
cursorParam: "after"
cursorPath: "$.meta.next_cursor"
pageSize: 50
responsePath: "$.results"
children:
- path: "/orders/{parent.id}/items"
as: "order_item"
responsePath: "$.items"
| Type | Fields | Description |
|---|---|---|
bearer | token | Bearer token in Authorization header |
api_key | key, header (default: X-API-Key) | API key in custom header |
basic | username, password | HTTP Basic authentication |
oauth2_client_credentials | tokenUrl, clientId, clientSecret, scope | OAuth2 client credentials flow with automatic token refresh |
All credential fields support {{ENV_VAR}} syntax for environment variable resolution.
| Type | Fields | Description |
|---|---|---|
offset | limitParam, offsetParam, pageSize | Offset-based (e.g. ?limit=100&offset=200) |
cursor | cursorParam, cursorPath, pageSize, limitParam | Cursor from response (e.g. ?after=abc123) |
link_header | pageSize, limitParam | RFC 5988 Link header with rel="next" |
page_number | pageParam, pageSize, limitParam | Page number (e.g. ?page=3) |
| Field | Description |
|---|---|
path | API endpoint path (required) |
method | HTTP method: GET (default) or POST |
as | Table name override (default: derived from last path segment) |
domain | Domain name for grouping (default: default) |
headers | Additional HTTP headers |
queryParams | Additional query parameters |
requestBody | JSON body for POST requests |
pagination | Pagination strategy (overrides defaults) |
responsePath | JSONPath to data array in response (e.g. $.data) |
incrementalField | Field for incremental extraction tracking |
children | Child endpoints using {parent.fieldName} path placeholders |
excludeFields | Regex patterns to exclude fields from schema |
restAPI:
defaults:
pagination:
type: offset
limitParam: "limit"
offsetParam: "offset"
pageSize: 100
headers:
X-Custom: "value"
endpoints:
- path: "/endpoint1" # inherits default pagination
- path: "/endpoint2"
pagination: # overrides default
type: cursor
cursorParam: "next"
cursorPath: "$.cursor"
pageSize: 50
The schema extractor infers Starlake types from JSON values:
| JSON Type | Starlake Type |
|---|---|
String (ISO date 2024-01-15) | date |
String (ISO datetime 2024-01-15T10:30:00Z) | timestamp |
| String (other) | string |
| Integer | long |
| Decimal | decimal |
| Boolean | boolean |
| Object | struct (with nested attributes) |
| Array of objects | struct with array: true |
| Array of scalars | scalar type with array: true |
When re-extracting schemas, Starlake compares the inferred schema against existing YAML definitions and logs warnings when:
This helps detect API changes early before they break downstream pipelines.
starlake extract-rest-schema --config my-rest-api
starlake extract-rest-schema --config my-rest-api --outputDir /tmp/schemas
Manage GizmoSQL processes: start, stop, list, and stop-all DuckLake-backed SQL servers
Create or modify database connections in application.sl.yml
Manage Quack DuckDB query servers exposing DuckLake over a thin remote protocol — serve (foreground), start/stop/list/stop-all (background)
Automatically infer schemas and load data from the incoming directory
Data quality expectations syntax, built-in macros, and validation patterns
Apply Row Level Security (RLS) and Column Level Security (CLS) policies