Skip to content

Commit 5ecc363

Browse files
hayssamsclaude
andauthored
Starlake: Add Rest API support (SchemaStore#5596)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent eef17e3 commit 5ecc363

12 files changed

Lines changed: 1133 additions & 1 deletion

src/schemas/json/starlake.json

Lines changed: 234 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@
16491649
}
16501650
},
16511651
"not": {
1652-
"required": ["openAPI"]
1652+
"anyOf": [{ "required": ["openAPI"] }, { "required": ["restAPI"] }]
16531653
}
16541654
}
16551655
]
@@ -1829,6 +1829,235 @@
18291829
}
18301830
]
18311831
},
1832+
"RestAPIAuthV1": {
1833+
"type": "object",
1834+
"description": "Authentication configuration for REST API extraction",
1835+
"properties": {
1836+
"type": {
1837+
"type": "string",
1838+
"description": "Authentication type",
1839+
"enum": ["bearer", "api_key", "basic", "oauth2_client_credentials"]
1840+
},
1841+
"token": {
1842+
"$ref": "#/definitions/ConvertibleToString",
1843+
"description": "Bearer token value. Supports {{ENV_VAR}} syntax."
1844+
},
1845+
"key": {
1846+
"$ref": "#/definitions/ConvertibleToString",
1847+
"description": "API key value for api_key auth."
1848+
},
1849+
"header": {
1850+
"$ref": "#/definitions/ConvertibleToString",
1851+
"description": "Header name for api_key auth. Defaults to X-API-Key."
1852+
},
1853+
"username": {
1854+
"$ref": "#/definitions/ConvertibleToString",
1855+
"description": "Username for basic auth."
1856+
},
1857+
"password": {
1858+
"$ref": "#/definitions/ConvertibleToString",
1859+
"description": "Password for basic auth."
1860+
},
1861+
"tokenUrl": {
1862+
"$ref": "#/definitions/ConvertibleToString",
1863+
"description": "Token endpoint URL for OAuth2 client credentials."
1864+
},
1865+
"clientId": {
1866+
"$ref": "#/definitions/ConvertibleToString",
1867+
"description": "Client ID for OAuth2."
1868+
},
1869+
"clientSecret": {
1870+
"$ref": "#/definitions/ConvertibleToString",
1871+
"description": "Client secret for OAuth2."
1872+
},
1873+
"scope": {
1874+
"$ref": "#/definitions/ConvertibleToString",
1875+
"description": "OAuth2 scope (optional)."
1876+
}
1877+
},
1878+
"required": ["type"]
1879+
},
1880+
"RestAPIPaginationV1": {
1881+
"type": "object",
1882+
"description": "Pagination strategy for REST API endpoints",
1883+
"properties": {
1884+
"type": {
1885+
"type": "string",
1886+
"description": "Pagination strategy type",
1887+
"enum": ["offset", "cursor", "link_header", "page_number"]
1888+
},
1889+
"limitParam": {
1890+
"$ref": "#/definitions/ConvertibleToString",
1891+
"description": "Query parameter name for page size limit."
1892+
},
1893+
"offsetParam": {
1894+
"$ref": "#/definitions/ConvertibleToString",
1895+
"description": "Query parameter name for offset (offset pagination)."
1896+
},
1897+
"cursorParam": {
1898+
"$ref": "#/definitions/ConvertibleToString",
1899+
"description": "Query parameter name for cursor value (cursor pagination)."
1900+
},
1901+
"cursorPath": {
1902+
"$ref": "#/definitions/ConvertibleToString",
1903+
"description": "JSONPath to extract cursor from response (e.g. $.meta.next_cursor)."
1904+
},
1905+
"pageParam": {
1906+
"$ref": "#/definitions/ConvertibleToString",
1907+
"description": "Query parameter name for page number (page_number pagination)."
1908+
},
1909+
"pageSize": {
1910+
"type": "integer",
1911+
"description": "Number of records per page. Defaults to 100.",
1912+
"default": 100
1913+
}
1914+
},
1915+
"required": ["type"]
1916+
},
1917+
"RestAPIEndpointV1": {
1918+
"type": "object",
1919+
"description": "REST API endpoint definition for data extraction",
1920+
"properties": {
1921+
"path": {
1922+
"$ref": "#/definitions/ConvertibleToString",
1923+
"description": "API endpoint path (e.g. /api/v2/customers)."
1924+
},
1925+
"method": {
1926+
"type": "string",
1927+
"description": "HTTP method. Defaults to GET.",
1928+
"enum": ["GET", "POST"],
1929+
"default": "GET"
1930+
},
1931+
"as": {
1932+
"$ref": "#/definitions/ConvertibleToString",
1933+
"description": "Table name override. If not set, derived from the last path segment."
1934+
},
1935+
"domain": {
1936+
"$ref": "#/definitions/ConvertibleToString",
1937+
"description": "Domain name to group this endpoint under. Defaults to 'default'.",
1938+
"default": "default"
1939+
},
1940+
"headers": {
1941+
"$ref": "#/definitions/MapString",
1942+
"description": "Additional HTTP headers for this endpoint."
1943+
},
1944+
"queryParams": {
1945+
"$ref": "#/definitions/MapString",
1946+
"description": "Additional query parameters for this endpoint."
1947+
},
1948+
"requestBody": {
1949+
"$ref": "#/definitions/ConvertibleToString",
1950+
"description": "JSON request body for POST endpoints."
1951+
},
1952+
"pagination": {
1953+
"$ref": "#/definitions/RestAPIPaginationV1",
1954+
"description": "Pagination strategy for this endpoint. Overrides defaults."
1955+
},
1956+
"responsePath": {
1957+
"$ref": "#/definitions/ConvertibleToString",
1958+
"description": "JSONPath to the data array in the response (e.g. $.data or $.results)."
1959+
},
1960+
"incrementalField": {
1961+
"$ref": "#/definitions/ConvertibleToString",
1962+
"description": "Field name used for incremental extraction. The max value is saved between runs."
1963+
},
1964+
"children": {
1965+
"type": "array",
1966+
"description": "Child endpoints that depend on parent records. Use {parent.fieldName} in path.",
1967+
"items": {
1968+
"$ref": "#/definitions/RestAPIEndpointV1"
1969+
}
1970+
},
1971+
"excludeFields": {
1972+
"type": "array",
1973+
"description": "List of regex patterns to exclude fields from extraction.",
1974+
"items": {
1975+
"$ref": "#/definitions/ConvertibleToString"
1976+
}
1977+
}
1978+
},
1979+
"required": ["path"]
1980+
},
1981+
"RestAPIDefaultsV1": {
1982+
"type": "object",
1983+
"description": "Default settings applied to all endpoints",
1984+
"properties": {
1985+
"pagination": {
1986+
"$ref": "#/definitions/RestAPIPaginationV1",
1987+
"description": "Default pagination strategy for all endpoints."
1988+
},
1989+
"headers": {
1990+
"$ref": "#/definitions/MapString",
1991+
"description": "Default headers applied to all endpoints."
1992+
},
1993+
"queryParams": {
1994+
"$ref": "#/definitions/MapString",
1995+
"description": "Default query parameters applied to all endpoints."
1996+
}
1997+
}
1998+
},
1999+
"RestAPIRateLimitV1": {
2000+
"type": "object",
2001+
"properties": {
2002+
"requestsPerSecond": {
2003+
"type": "integer",
2004+
"description": "Maximum number of requests per second. Defaults to 10.",
2005+
"default": 10
2006+
}
2007+
}
2008+
},
2009+
"RestAPIV1": {
2010+
"type": "object",
2011+
"description": "REST API extraction configuration",
2012+
"properties": {
2013+
"baseUrl": {
2014+
"$ref": "#/definitions/ConvertibleToString",
2015+
"description": "Base URL of the REST API (e.g. https://api.example.com/v2)."
2016+
},
2017+
"auth": {
2018+
"$ref": "#/definitions/RestAPIAuthV1",
2019+
"description": "Authentication configuration."
2020+
},
2021+
"headers": {
2022+
"$ref": "#/definitions/MapString",
2023+
"description": "Global HTTP headers applied to all requests."
2024+
},
2025+
"rateLimit": {
2026+
"$ref": "#/definitions/RestAPIRateLimitV1",
2027+
"description": "Rate limiting configuration."
2028+
},
2029+
"defaults": {
2030+
"$ref": "#/definitions/RestAPIDefaultsV1",
2031+
"description": "Default settings applied to all endpoints."
2032+
},
2033+
"endpoints": {
2034+
"type": "array",
2035+
"description": "List of API endpoints to extract data from.",
2036+
"minItems": 1,
2037+
"items": {
2038+
"$ref": "#/definitions/RestAPIEndpointV1"
2039+
}
2040+
}
2041+
},
2042+
"required": ["baseUrl", "endpoints"]
2043+
},
2044+
"RestAPIsV1": {
2045+
"type": "object",
2046+
"allOf": [
2047+
{
2048+
"$ref": "#/definitions/ExtractV1Base"
2049+
},
2050+
{
2051+
"properties": {
2052+
"restAPI": {
2053+
"$ref": "#/definitions/RestAPIV1",
2054+
"description": "Describe how to extract data from REST API endpoints"
2055+
}
2056+
},
2057+
"required": ["restAPI"]
2058+
}
2059+
]
2060+
},
18322061
"ExtractV1Base": {
18332062
"type": "object",
18342063
"properties": {
@@ -2406,6 +2635,10 @@
24062635
{
24072636
"$ref": "#/definitions/OpenAPIsV1",
24082637
"description": "Defines OpenAPI schemas extraction"
2638+
},
2639+
{
2640+
"$ref": "#/definitions/RestAPIsV1",
2641+
"description": "Defines REST API data extraction"
24092642
}
24102643
]
24112644
},

0 commit comments

Comments
 (0)