/starlake-skills:extract-rest-schemafrom starlake-skills
Infer table schemas from REST API endpoints with `starlake extract-rest-schema`: fetch sample JSON responses and reverse-engineer them into Starlake YAML domain/table definitions (schema only; use extract-rest-data for the rows)
Ships in starlake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (starlake-ai/starlake-skills) — no native marketplace selected
npx claudepluginhub p/starlake-ai-starlake-skills75 skills in this plugin
/acl-dependenciesVisualize access control with `starlake acl-dependencies` — graph which users and groups can access which tables, from the ACL and RLS (row-level security) definitions in your YAML, output as SVG, PNG, or JSON/autoloadInfer schemas from files in the incoming directory and load them into the warehouse in one step with `starlake autoload`. Use for quick starts or new data files with no YAML table definitions yet; generates the table configs automatically./bootstrapCreate a new Starlake project with `starlake bootstrap` — scaffold the standard metadata/load/transform directory structure and starter config from a template (quickstart, simple). Use when initializing or setting up a new project./bq-infoGet BigQuery table information with `starlake bq-info` — schema, row count, size, partitioning, and clustering details for datasets and tables in a GCP project/cnxloadLoad a Parquet, CSV, or JSON file directly into a JDBC database table with `starlake cnxload`. Use to push one file into PostgreSQL, MySQL, or any JDBC target without the full Starlake load pipeline or YAML schemas./col-lineageTrace column-level lineage for one transform task with `starlake col-lineage` — show how each output column derives from its source columns through the SQL, for fine-grained data provenance and impact analysis