From 432e0407de2aa9931c67489f366c16b696ac64cc Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Sat, 7 Feb 2026 14:17:49 -0800 Subject: [PATCH] feat(122): make path fields readOnly The `path` field that exists on the resource cannot be modified, and should be a readOnly field. --- aep/general/0122/aep.md.j2 | 5 +++++ aep/general/example.oas.yaml | 6 ++++++ aep/general/example.proto | 42 ++++++++++++++++++++++++++++++------ 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/aep/general/0122/aep.md.j2 b/aep/general/0122/aep.md.j2 index 07f2919a..fe684aef 100644 --- a/aep/general/0122/aep.md.j2 +++ b/aep/general/0122/aep.md.j2 @@ -52,10 +52,15 @@ users/vhugo1802 {% sample '../example.proto', 'message Book' %} +- The `path` field for the resource **must** be annotated with `OUTPUT_ONLY`. + {% tab oas %} {% sample '../example.oas.yaml', '$.components.schemas.book.properties.path' %} +- The `path` field for the resource **must** be annotated with + `readOnly: true`. + {% endtabs %} **Note:** Resource paths as described here are used within the scope of a diff --git a/aep/general/example.oas.yaml b/aep/general/example.oas.yaml index 024f3683..e519e320 100644 --- a/aep/general/example.oas.yaml +++ b/aep/general/example.oas.yaml @@ -22,6 +22,7 @@ components: description: The server-assigned path of the resource, which is unique within the service. + readOnly: true type: string price: format: int32 @@ -50,6 +51,7 @@ components: description: The server-assigned path of the resource, which is unique within the service. + readOnly: true type: string required: - display_name @@ -68,6 +70,7 @@ components: description: The server-assigned path of the resource, which is unique within the service. + readOnly: true type: string type: object x-aep-resource: @@ -86,6 +89,7 @@ components: description: The server-assigned path of the resource, which is unique within the service. + readOnly: true type: string price: format: double @@ -111,6 +115,7 @@ components: description: The server-assigned path of the resource, which is unique within the service. + readOnly: true type: string type: object x-aep-resource: @@ -129,6 +134,7 @@ components: description: The server-assigned path of the resource, which is unique within the service. + readOnly: true type: string required: - name diff --git a/aep/general/example.proto b/aep/general/example.proto index 4eb36e1a..eaf01433 100644 --- a/aep/general/example.proto +++ b/aep/general/example.proto @@ -326,7 +326,12 @@ message Book { repeated Author author = 5; // Field for path. - string path = 10018; + string path = 10018 [ + (aep.api.field_info) = { + field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY] + }, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // A BookEdition. @@ -348,7 +353,12 @@ message BookEdition { ]; // Field for path. - string path = 10018; + string path = 10018 [ + (aep.api.field_info) = { + field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY] + }, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // A Isbn. @@ -361,7 +371,12 @@ message Isbn { }; // Field for path. - string path = 10018; + string path = 10018 [ + (aep.api.field_info) = { + field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY] + }, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // A Item. @@ -393,7 +408,12 @@ message Item { ]; // Field for path. - string path = 10018; + string path = 10018 [ + (aep.api.field_info) = { + field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY] + }, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // A Publisher. @@ -409,7 +429,12 @@ message Publisher { string description = 1; // Field for path. - string path = 10018; + string path = 10018 [ + (aep.api.field_info) = { + field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY] + }, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // A Store. @@ -433,7 +458,12 @@ message Store { string description = 2; // Field for path. - string path = 10018; + string path = 10018 [ + (aep.api.field_info) = { + field_behavior: [FIELD_BEHAVIOR_OUTPUT_ONLY] + }, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // A Create request for a book resource.