Skip to content

Commit 9705046

Browse files
authored
feat(aepc): readOnly path params (#80)
update aep-lib-go to pull in readOnly path fields in the resource.
1 parent dfe5808 commit 9705046

7 files changed

Lines changed: 684 additions & 627 deletions

File tree

example/bookstore/v1/bookstore.pb.go

Lines changed: 618 additions & 614 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/bookstore/v1/bookstore.proto

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ message Book {
326326
repeated Author author = 5;
327327

328328
// Field for path.
329-
string path = 10018;
329+
string path = 10018 [
330+
(aep.api.field_info) = {
331+
field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY]
332+
},
333+
(google.api.field_behavior) = OUTPUT_ONLY
334+
];
330335
}
331336

332337
// A BookEdition.
@@ -348,7 +353,12 @@ message BookEdition {
348353
];
349354

350355
// Field for path.
351-
string path = 10018;
356+
string path = 10018 [
357+
(aep.api.field_info) = {
358+
field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY]
359+
},
360+
(google.api.field_behavior) = OUTPUT_ONLY
361+
];
352362
}
353363

354364
// A Isbn.
@@ -361,7 +371,12 @@ message Isbn {
361371
};
362372

363373
// Field for path.
364-
string path = 10018;
374+
string path = 10018 [
375+
(aep.api.field_info) = {
376+
field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY]
377+
},
378+
(google.api.field_behavior) = OUTPUT_ONLY
379+
];
365380
}
366381

367382
// A Item.
@@ -393,7 +408,12 @@ message Item {
393408
];
394409

395410
// Field for path.
396-
string path = 10018;
411+
string path = 10018 [
412+
(aep.api.field_info) = {
413+
field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY]
414+
},
415+
(google.api.field_behavior) = OUTPUT_ONLY
416+
];
397417
}
398418

399419
// A Publisher.
@@ -409,7 +429,12 @@ message Publisher {
409429
string description = 1;
410430

411431
// Field for path.
412-
string path = 10018;
432+
string path = 10018 [
433+
(aep.api.field_info) = {
434+
field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY]
435+
},
436+
(google.api.field_behavior) = OUTPUT_ONLY
437+
];
413438
}
414439

415440
// A Store.
@@ -433,7 +458,12 @@ message Store {
433458
string description = 2;
434459

435460
// Field for path.
436-
string path = 10018;
461+
string path = 10018 [
462+
(aep.api.field_info) = {
463+
field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY]
464+
},
465+
(google.api.field_behavior) = OUTPUT_ONLY
466+
];
437467
}
438468

439469
// A Create request for a book resource.

example/bookstore/v1/bookstore.swagger.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,8 @@
15081508
},
15091509
"path": {
15101510
"type": "string",
1511-
"description": "Field for path."
1511+
"description": "Field for path.",
1512+
"readOnly": true
15121513
}
15131514
},
15141515
"description": "A Book.",
@@ -1528,7 +1529,8 @@
15281529
},
15291530
"path": {
15301531
"type": "string",
1531-
"description": "Field for path."
1532+
"description": "Field for path.",
1533+
"readOnly": true
15321534
}
15331535
},
15341536
"description": "A BookEdition.",
@@ -1541,7 +1543,8 @@
15411543
"properties": {
15421544
"path": {
15431545
"type": "string",
1544-
"description": "Field for path."
1546+
"description": "Field for path.",
1547+
"readOnly": true
15451548
}
15461549
},
15471550
"description": "A Isbn."
@@ -1564,7 +1567,8 @@
15641567
},
15651568
"path": {
15661569
"type": "string",
1567-
"description": "Field for path."
1570+
"description": "Field for path.",
1571+
"readOnly": true
15681572
}
15691573
},
15701574
"description": "A Item.",
@@ -1698,7 +1702,8 @@
16981702
},
16991703
"path": {
17001704
"type": "string",
1701-
"description": "Field for path."
1705+
"description": "Field for path.",
1706+
"readOnly": true
17021707
}
17031708
},
17041709
"description": "A Publisher."
@@ -1716,7 +1721,8 @@
17161721
},
17171722
"path": {
17181723
"type": "string",
1719-
"description": "Field for path."
1724+
"description": "Field for path.",
1725+
"readOnly": true
17201726
}
17211727
},
17221728
"description": "A Store.",

example/bookstore/v1/bookstore_openapi.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,7 @@
13741374
},
13751375
"path": {
13761376
"type": "string",
1377+
"readOnly": true,
13771378
"description": "The server-assigned path of the resource, which is unique within the service."
13781379
},
13791380
"price": {
@@ -1410,6 +1411,7 @@
14101411
},
14111412
"path": {
14121413
"type": "string",
1414+
"readOnly": true,
14131415
"description": "The server-assigned path of the resource, which is unique within the service."
14141416
}
14151417
},
@@ -1433,6 +1435,7 @@
14331435
"properties": {
14341436
"path": {
14351437
"type": "string",
1438+
"readOnly": true,
14361439
"description": "The server-assigned path of the resource, which is unique within the service."
14371440
}
14381441
},
@@ -1456,6 +1459,7 @@
14561459
},
14571460
"path": {
14581461
"type": "string",
1462+
"readOnly": true,
14591463
"description": "The server-assigned path of the resource, which is unique within the service."
14601464
},
14611465
"price": {
@@ -1488,6 +1492,7 @@
14881492
},
14891493
"path": {
14901494
"type": "string",
1495+
"readOnly": true,
14911496
"description": "The server-assigned path of the resource, which is unique within the service."
14921497
}
14931498
},
@@ -1511,6 +1516,7 @@
15111516
},
15121517
"path": {
15131518
"type": "string",
1519+
"readOnly": true,
15141520
"description": "The server-assigned path of the resource, which is unique within the service."
15151521
}
15161522
},

example/bookstore/v1/bookstore_openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ components:
2525
path:
2626
description: The server-assigned path of the resource, which is unique within
2727
the service.
28+
readOnly: true
2829
type: string
2930
price:
3031
format: int32
@@ -52,6 +53,7 @@ components:
5253
path:
5354
description: The server-assigned path of the resource, which is unique within
5455
the service.
56+
readOnly: true
5557
type: string
5658
required:
5759
- display_name
@@ -69,6 +71,7 @@ components:
6971
path:
7072
description: The server-assigned path of the resource, which is unique within
7173
the service.
74+
readOnly: true
7275
type: string
7376
type: object
7477
x-aep-resource:
@@ -86,6 +89,7 @@ components:
8689
path:
8790
description: The server-assigned path of the resource, which is unique within
8891
the service.
92+
readOnly: true
8993
type: string
9094
price:
9195
format: double
@@ -110,6 +114,7 @@ components:
110114
path:
111115
description: The server-assigned path of the resource, which is unique within
112116
the service.
117+
readOnly: true
113118
type: string
114119
type: object
115120
x-aep-resource:
@@ -127,6 +132,7 @@ components:
127132
path:
128133
description: The server-assigned path of the resource, which is unique within
129134
the service.
135+
readOnly: true
130136
type: string
131137
required:
132138
- name

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.23.6
77
require (
88
buf.build/gen/go/aep/api/protocolbuffers/go v1.36.10-20251109183837-26a011a354ee.1
99
cloud.google.com/go/longrunning v0.6.6
10-
github.com/aep-dev/aep-lib-go v0.0.0-20251111165230-98620886fcd9
10+
github.com/aep-dev/aep-lib-go v0.0.0-20260208052831-f2a02f53a637
1111
github.com/aep-dev/terraform-provider-aep v0.0.0-20241112052633-f48d45460768
1212
github.com/google/cel-go v0.22.1
1313
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0
@@ -105,3 +105,6 @@ require (
105105
golang.org/x/sys v0.31.0 // indirect
106106
golang.org/x/text v0.23.0 // indirect
107107
)
108+
109+
// uncomment for local development
110+
// replace github.com/aep-dev/aep-lib-go => ../aep-lib-go

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV
2020
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
2121
github.com/aep-dev/aep-lib-go v0.0.0-20251111165230-98620886fcd9 h1:7cTm+JDlHZUaxkL8X/VJl6G+Nxn42VYDtiyM4xKgXEo=
2222
github.com/aep-dev/aep-lib-go v0.0.0-20251111165230-98620886fcd9/go.mod h1:oPOz/8HDQAI0sR+pHSteMkiP/WHM3RNHKY4DctnwVpo=
23+
github.com/aep-dev/aep-lib-go v0.0.0-20260208052831-f2a02f53a637 h1:7tZhVn+a3e1ITD5KC+jITawtd+kuNNC+ePFDhDw5bYQ=
24+
github.com/aep-dev/aep-lib-go v0.0.0-20260208052831-f2a02f53a637/go.mod h1:oPOz/8HDQAI0sR+pHSteMkiP/WHM3RNHKY4DctnwVpo=
2325
github.com/aep-dev/terraform-provider-aep v0.0.0-20241112052633-f48d45460768 h1:b5fRfpIIsOsdsT2N1MsBxr0K/fZacCUlWp0uY9/BJzM=
2426
github.com/aep-dev/terraform-provider-aep v0.0.0-20241112052633-f48d45460768/go.mod h1:sUuUJSkWTc4GBxp8GEZXCeEI38VMyuM5msPQ9BG0kMA=
2527
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=

0 commit comments

Comments
 (0)