Skip to content

Commit ffcaec9

Browse files
committed
add @doc comments for remaining fields in APIMetadata, update CLAUDE.md to execute verification of ./build-schema command for all 4 schema types (gcp+core)
1 parent 4ea040e commit ffcaec9

6 files changed

Lines changed: 71 additions & 8 deletions

File tree

CLAUDE.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ npm run build:all # Generate all variants with Swagger
1313

1414
**Validation workflow:**
1515
```bash
16-
npm install # Install dependencies
17-
npm run build:core # Build and verify compilation
18-
npm run build:gcp # Build GCP variant
19-
ls -l schemas/*/openapi.yaml # Confirm outputs exist
16+
npm install # Install dependencies
17+
./build-schema.sh gcp # Build GCP OpenAPI 3.0
18+
./build-schema.sh gcp --swagger # Build GCP OpenAPI 2.0 (Swagger)
19+
./build-schema.sh core # Build core OpenAPI 3.0
20+
./build-schema.sh core --swagger # Build core OpenAPI 2.0 (Swagger)
21+
ls -l schemas/*/openapi.yaml # Confirm outputs exist
2022
```
2123

2224
## Key Concepts
@@ -98,7 +100,11 @@ services/
98100
- Commit `node_modules/` or build artifacts
99101

100102
**DO:**
101-
- Run `npm run build:all` before committing schema changes
103+
- Run builds in this order before committing schema changes:
104+
1. `./build-schema.sh gcp`
105+
2. `./build-schema.sh gcp --swagger`
106+
3. `./build-schema.sh core`
107+
4. `./build-schema.sh core --swagger`
102108
- Test both provider variants when modifying shared models
103109
- Keep TypeSpec files focused (one resource per service file)
104110
- Use semantic versioning for releases (see RELEASING.md)
@@ -187,8 +193,10 @@ Build: `npm run build:gcp`
187193
Before submitting changes:
188194

189195
- [ ] Dependencies installed: `npm install`
190-
- [ ] Core variant builds: `npm run build:core`
191-
- [ ] GCP variant builds: `npm run build:gcp`
196+
- [ ] GCP variant builds: `./build-schema.sh gcp`
197+
- [ ] GCP Swagger builds: `./build-schema.sh gcp --swagger`
198+
- [ ] Core variant builds: `./build-schema.sh core`
199+
- [ ] Core Swagger builds: `./build-schema.sh core --swagger`
192200
- [ ] Schema files generated: `ls schemas/*/openapi.yaml`
193201
- [ ] No TypeSpec compilation errors (check output)
194202
- [ ] Changes committed including schema updates

models/common/model.tsp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,21 @@ model APIResource {
112112
labels?: Record<string>;
113113
}
114114
model APIMetadata {
115+
@doc("Timestamp when the resource was created")
115116
@format("date-time") created_time: string;
117+
118+
@doc("Timestamp when the resource was last updated")
116119
@format("date-time") updated_time: string;
120+
121+
@doc("Identity that created the resource")
117122
@format("email") created_by: string;
123+
124+
@doc("Identity that last updated the resource")
118125
@format("email") updated_by: string;
119126

120127
@doc("Timestamp when deletion was requested; omitted if not marked for deletion")
121128
@format("date-time") deleted_time?: string;
122-
129+
123130
@doc("Identity that requested deletion; omitted if not marked for deletion")
124131
@format("email") deleted_by?: string;
125132
}

schemas/core/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,15 +910,19 @@ components:
910910
created_time:
911911
type: string
912912
format: date-time
913+
description: Timestamp when the resource was created
913914
updated_time:
914915
type: string
915916
format: date-time
917+
description: Timestamp when the resource was last updated
916918
created_by:
917919
type: string
918920
format: email
921+
description: Identity that created the resource
919922
updated_by:
920923
type: string
921924
format: email
925+
description: Identity that last updated the resource
922926
deleted_time:
923927
type: string
924928
format: date-time
@@ -1175,15 +1179,19 @@ components:
11751179
created_time:
11761180
type: string
11771181
format: date-time
1182+
description: Timestamp when the resource was created
11781183
updated_time:
11791184
type: string
11801185
format: date-time
1186+
description: Timestamp when the resource was last updated
11811187
created_by:
11821188
type: string
11831189
format: email
1190+
description: Identity that created the resource
11841191
updated_by:
11851192
type: string
11861193
format: email
1194+
description: Identity that last updated the resource
11871195
deleted_time:
11881196
type: string
11891197
format: date-time
@@ -1325,15 +1333,19 @@ components:
13251333
created_time:
13261334
type: string
13271335
format: date-time
1336+
description: Timestamp when the resource was created
13281337
updated_time:
13291338
type: string
13301339
format: date-time
1340+
description: Timestamp when the resource was last updated
13311341
created_by:
13321342
type: string
13331343
format: email
1344+
description: Identity that created the resource
13341345
updated_by:
13351346
type: string
13361347
format: email
1348+
description: Identity that last updated the resource
13371349
deleted_time:
13381350
type: string
13391351
format: date-time

schemas/core/swagger.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,11 @@ definitions:
10761076
updated_time: '2021-01-01T10:02:00Z'
10771077
properties:
10781078
created_by:
1079+
description: Identity that created the resource
10791080
format: email
10801081
type: string
10811082
created_time:
1083+
description: Timestamp when the resource was created
10821084
format: date-time
10831085
type: string
10841086
deleted_by:
@@ -1123,9 +1125,11 @@ definitions:
11231125
status:
11241126
$ref: '#/definitions/ClusterStatus'
11251127
updated_by:
1128+
description: Identity that last updated the resource
11261129
format: email
11271130
type: string
11281131
updated_time:
1132+
description: Timestamp when the resource was last updated
11291133
format: date-time
11301134
type: string
11311135
required:
@@ -1362,9 +1366,11 @@ definitions:
13621366
updated_time: '2021-01-01T10:02:00Z'
13631367
properties:
13641368
created_by:
1369+
description: Identity that created the resource
13651370
format: email
13661371
type: string
13671372
created_time:
1373+
description: Timestamp when the resource was created
13681374
format: date-time
13691375
type: string
13701376
deleted_by:
@@ -1411,9 +1417,11 @@ definitions:
14111417
status:
14121418
$ref: '#/definitions/NodePoolStatus'
14131419
updated_by:
1420+
description: Identity that last updated the resource
14141421
format: email
14151422
type: string
14161423
updated_time:
1424+
description: Timestamp when the resource was last updated
14171425
format: date-time
14181426
type: string
14191427
required:
@@ -1464,9 +1472,11 @@ definitions:
14641472
NodePoolCreateResponse:
14651473
properties:
14661474
created_by:
1475+
description: Identity that created the resource
14671476
format: email
14681477
type: string
14691478
created_time:
1479+
description: Timestamp when the resource was created
14701480
format: date-time
14711481
type: string
14721482
deleted_by:
@@ -1513,9 +1523,11 @@ definitions:
15131523
status:
15141524
$ref: '#/definitions/NodePoolStatus'
15151525
updated_by:
1526+
description: Identity that last updated the resource
15161527
format: email
15171528
type: string
15181529
updated_time:
1530+
description: Timestamp when the resource was last updated
15191531
format: date-time
15201532
type: string
15211533
required:

schemas/gcp/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,15 +827,19 @@ components:
827827
created_time:
828828
type: string
829829
format: date-time
830+
description: Timestamp when the resource was created
830831
updated_time:
831832
type: string
832833
format: date-time
834+
description: Timestamp when the resource was last updated
833835
created_by:
834836
type: string
835837
format: email
838+
description: Identity that created the resource
836839
updated_by:
837840
type: string
838841
format: email
842+
description: Identity that last updated the resource
839843
deleted_time:
840844
type: string
841845
format: date-time
@@ -1170,15 +1174,19 @@ components:
11701174
created_time:
11711175
type: string
11721176
format: date-time
1177+
description: Timestamp when the resource was created
11731178
updated_time:
11741179
type: string
11751180
format: date-time
1181+
description: Timestamp when the resource was last updated
11761182
created_by:
11771183
type: string
11781184
format: email
1185+
description: Identity that created the resource
11791186
updated_by:
11801187
type: string
11811188
format: email
1189+
description: Identity that last updated the resource
11821190
deleted_time:
11831191
type: string
11841192
format: date-time
@@ -1358,15 +1366,19 @@ components:
13581366
created_time:
13591367
type: string
13601368
format: date-time
1369+
description: Timestamp when the resource was created
13611370
updated_time:
13621371
type: string
13631372
format: date-time
1373+
description: Timestamp when the resource was last updated
13641374
created_by:
13651375
type: string
13661376
format: email
1377+
description: Identity that created the resource
13671378
updated_by:
13681379
type: string
13691380
format: email
1381+
description: Identity that last updated the resource
13701382
deleted_time:
13711383
type: string
13721384
format: date-time

schemas/gcp/swagger.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,11 @@ definitions:
994994
updated_time: '2021-01-01T10:02:00Z'
995995
properties:
996996
created_by:
997+
description: Identity that created the resource
997998
format: email
998999
type: string
9991000
created_time:
1001+
description: Timestamp when the resource was created
10001002
format: date-time
10011003
type: string
10021004
deleted_by:
@@ -1041,9 +1043,11 @@ definitions:
10411043
status:
10421044
$ref: '#/definitions/ClusterStatus'
10431045
updated_by:
1046+
description: Identity that last updated the resource
10441047
format: email
10451048
type: string
10461049
updated_time:
1050+
description: Timestamp when the resource was last updated
10471051
format: date-time
10481052
type: string
10491053
required:
@@ -1356,9 +1360,11 @@ definitions:
13561360
updated_time: '2021-01-01T10:02:00Z'
13571361
properties:
13581362
created_by:
1363+
description: Identity that created the resource
13591364
format: email
13601365
type: string
13611366
created_time:
1367+
description: Timestamp when the resource was created
13621368
format: date-time
13631369
type: string
13641370
deleted_by:
@@ -1405,9 +1411,11 @@ definitions:
14051411
status:
14061412
$ref: '#/definitions/NodePoolStatus'
14071413
updated_by:
1414+
description: Identity that last updated the resource
14081415
format: email
14091416
type: string
14101417
updated_time:
1418+
description: Timestamp when the resource was last updated
14111419
format: date-time
14121420
type: string
14131421
required:
@@ -1477,9 +1485,11 @@ definitions:
14771485
NodePoolCreateResponse:
14781486
properties:
14791487
created_by:
1488+
description: Identity that created the resource
14801489
format: email
14811490
type: string
14821491
created_time:
1492+
description: Timestamp when the resource was created
14831493
format: date-time
14841494
type: string
14851495
deleted_by:
@@ -1526,9 +1536,11 @@ definitions:
15261536
status:
15271537
$ref: '#/definitions/NodePoolStatus'
15281538
updated_by:
1539+
description: Identity that last updated the resource
15291540
format: email
15301541
type: string
15311542
updated_time:
1543+
description: Timestamp when the resource was last updated
15321544
format: date-time
15331545
type: string
15341546
required:

0 commit comments

Comments
 (0)