Skip to content

Commit 98c4972

Browse files
committed
Tag untagged endpoints (/metrics, /envs) as Others so they appear in the correct section
1 parent 31adab7 commit 98c4972

2 files changed

Lines changed: 42 additions & 35 deletions

File tree

openapi-public.yml

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,42 @@ paths:
17371737
- Others
17381738
servers:
17391739
- *id005
1740+
/metrics:
1741+
get:
1742+
summary: Get the stats of the service
1743+
security:
1744+
- *id004
1745+
responses:
1746+
'200':
1747+
description: The resource usage metrics of the service
1748+
content:
1749+
application/json:
1750+
schema:
1751+
$ref: '#/components/schemas/Metrics'
1752+
'502': *id003
1753+
operationId: getMetrics
1754+
tags:
1755+
- Others
1756+
servers:
1757+
- *id005
1758+
/envs:
1759+
get:
1760+
summary: Get the environment variables
1761+
security:
1762+
- *id004
1763+
responses:
1764+
'200':
1765+
description: Environment variables
1766+
content:
1767+
application/json:
1768+
schema:
1769+
$ref: '#/components/schemas/EnvVars'
1770+
'502': *id003
1771+
operationId: getEnvVars
1772+
tags:
1773+
- Others
1774+
servers:
1775+
- *id005
17401776
/files:
17411777
get:
17421778
summary: Download a file
@@ -1791,38 +1827,6 @@ paths:
17911827
operationId: uploadFile
17921828
servers:
17931829
- *id005
1794-
/metrics:
1795-
get:
1796-
summary: Get the stats of the service
1797-
security:
1798-
- *id004
1799-
responses:
1800-
'200':
1801-
description: The resource usage metrics of the service
1802-
content:
1803-
application/json:
1804-
schema:
1805-
$ref: '#/components/schemas/Metrics'
1806-
'502': *id003
1807-
operationId: getMetrics
1808-
servers:
1809-
- *id005
1810-
/envs:
1811-
get:
1812-
summary: Get the environment variables
1813-
security:
1814-
- *id004
1815-
responses:
1816-
'200':
1817-
description: Environment variables
1818-
content:
1819-
application/json:
1820-
schema:
1821-
$ref: '#/components/schemas/EnvVars'
1822-
'502': *id003
1823-
operationId: getEnvVars
1824-
servers:
1825-
- *id005
18261830
components:
18271831
securitySchemes:
18281832
AccessTokenAuth:

scripts/generate_openapi_reference.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,13 +1241,16 @@ def rename_and_reorder_tags(spec: dict[str, Any]) -> None:
12411241
}
12421242
TAG_ORDER = ["Sandboxes", "Templates", "Filesystem", "Process", "Tags", "Teams", "Others"]
12431243

1244-
# Rename tags on all operations
1244+
# Rename tags on all operations; tag untagged ones as "Others"
12451245
for path_item in spec.get("paths", {}).values():
12461246
for method in ("get", "post", "put", "patch", "delete", "head", "options"):
12471247
op = path_item.get(method)
1248-
if not op or "tags" not in op:
1248+
if not op:
12491249
continue
1250-
op["tags"] = [TAG_RENAME.get(t, t) for t in op["tags"]]
1250+
if "tags" not in op:
1251+
op["tags"] = ["Others"]
1252+
else:
1253+
op["tags"] = [TAG_RENAME.get(t, t) for t in op["tags"]]
12511254

12521255
# Rebuild the top-level tags list in the desired order
12531256
spec["tags"] = [{"name": t} for t in TAG_ORDER]

0 commit comments

Comments
 (0)