Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 9, 2025

Adds aep.api.resource proto annotation similar to google.api.resource, enabling resource metadata definition with AEP-specific extensions.

Changes

  • New file: proto/aep-api/aep/api/resource.proto
    • ResourceDescriptor message with fields: type, pattern (repeated), singular, plural, parent (repeated)
    • Extension for google.protobuf.MessageOptions (ID: 1266)
    • The parent field allows specifying multiple parent resource types in singular form
    • Resource types use kebab-case (lowercase with dashes)
    • Pattern variables use _id suffix convention (e.g., {project_id}, {topic_id})

Usage

message Book {
  option (aep.api.resource) = {
    type: "library.example.com/book"
    pattern: "publishers/{publisher_id}/books/{book_id}"
    singular: "book"
    plural: "books"
    parent: "publisher"
  };
}

// Multiple patterns and parents
message Document {
  option (aep.api.resource) = {
    type: "docs.example.com/document"
    pattern: "projects/{project_id}/documents/{document_id}"
    pattern: "folders/{folder_id}/documents/{document_id}"
    singular: "document"
    plural: "documents"
    parent: "project"
    parent: "folder"
  };
}

Subset of google.api.resource fields chosen per issue requirements. Extension ID 1266 from registered aep.dev range (1264-1274).

Original prompt

This section details on the original issue you should resolve

<issue_title>add aep.api.resource annotation for resources</issue_title>
<issue_description>Similar to google.api.resource, the aeps should have their own proto annotation for resources (to allow for extensions of new metadata as needed). see https://buf.build/googleapis/googleapis/file/main:google/api/resource.proto.

The annotation should have a limited subset of the original fields (plural, singular, type, and patterns). Also the parents repeated string field should be added, to enable the specification of one or more parents of the resource.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 9, 2025
Copilot AI and others added 2 commits November 9, 2025 05:06
Co-authored-by: toumorokoshi <391240+toumorokoshi@users.noreply.github.com>
Co-authored-by: toumorokoshi <391240+toumorokoshi@users.noreply.github.com>
Copilot AI changed the title [WIP] Add aep.api.resource annotation for resources Add aep.api.resource annotation for resource definitions Nov 9, 2025
Copilot AI requested a review from toumorokoshi November 9, 2025 05:12
Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! please see comments, getting close.

Co-authored-by: toumorokoshi <391240+toumorokoshi@users.noreply.github.com>
Co-authored-by: toumorokoshi <391240+toumorokoshi@users.noreply.github.com>
Co-authored-by: toumorokoshi <391240+toumorokoshi@users.noreply.github.com>
Copilot AI requested a review from toumorokoshi November 9, 2025 06:11
@toumorokoshi toumorokoshi marked this pull request as ready for review November 9, 2025 06:12
@toumorokoshi toumorokoshi requested a review from a team as a code owner November 9, 2025 06:12
@toumorokoshi toumorokoshi requested review from rambleraptor and removed request for toumorokoshi November 9, 2025 06:12
@toumorokoshi
Copy link
Member

@rambleraptor I think we have one more proto annotation we need add for ourselves 😅 . Can you take a look?

@toumorokoshi toumorokoshi requested review from toumorokoshi and removed request for toumorokoshi November 9, 2025 06:13
Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@rambleraptor rambleraptor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. We'll need to make the corresponding linter changes as well

@toumorokoshi
Copy link
Member

Looks great to me. We'll need to make the corresponding linter changes as well

agreed! Is something you can take on @rambleraptor ?

@toumorokoshi toumorokoshi merged commit 1d44c22 into main Nov 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add aep.api.resource annotation for resources

3 participants