Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt AEP 231 - Batch Get #177

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

mkistler
Copy link
Contributor

Adopt AEP 231 - Batch Get

🍱 Types of changes

What types of changes does your code introduce to AEP? Put an x in the boxes
that apply

  • Enhancement
  • New proposal
  • Migrated from google.aip.dev
  • Chore / Quick Fix

📋 Your checklist for this pull request

Please review the AEP Style and Guidance for
contributing to this repository.

General

Additional checklist for a new AEP

  • A new AEP should be no more than two pages if printed out.
  • Ensure that the PR is editable by maintainers.
  • Ensure that File structure
    guidelines are met.
  • Ensure that
    Document structure
    guidelines are met.

💝 Thank you!

@mkistler mkistler requested a review from a team as a code owner April 22, 2024 14:26
@mkistler mkistler linked an issue Apr 26, 2024 that may be closed by this pull request
aep/general/0231/aep.md.j2 Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Show resolved Hide resolved
@mkistler mkistler requested a review from rofrankel April 27, 2024 14:33
@mkistler
Copy link
Contributor Author

@rofrankel Please re-review.

aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
@mkistler
Copy link
Contributor Author

@rofrankel Thanks for the re-review. I addressed your comments and asked for a new review.

@mkistler
Copy link
Contributor Author

I made the updates we discussed three weeks ago. Please re-review and let me know if there is any additional feedback.

- The URI path **should** represent the collection for the resource, matching
the collection used for simple CRUD operations. If the operation spans
parents, a dash (`-`) **may** be accepted as a wildcard.
- The HTTP URI **must** end with `:BatchGet`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the casing change here? aep.dev/custom-methods still uses camelCase rather than PascalCase.

Comment on lines +27 to +29
- The request **must** include an array parameter which accepts the resource
paths specifying the resources to retrieve. The parameter **should** be named
`paths`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- The request **must** include an array parameter which accepts the resource
paths specifying the resources to retrieve. The parameter **should** be named
`paths`.
- The request **must** include an array field which accepts the resource
paths specifying the resources to retrieve. The field **should** be named
`paths`.

I think we use "field" reasonably consistently across the other AEPs. (Suggestion applies to below uses of "parameter" as well.)

`paths`.
- If no resource paths are provided, the API **should** error with
`INVALID_ARGUMENT`.
- The parameter **should** be required.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not must? And is this redundant with the previous bullet point?

- If no resource paths are provided, the API **should** error with
`INVALID_ARGUMENT`.
- The parameter **should** be required.
- The parameter **should** identify the [resource type](./paths) that it
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "identify" mean in this context?

- The parameter **should** be required.
- The parameter **should** identify the [resource type](./paths) that it
references.
- The parameter should define the pattern of the resource path values.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this mean, concretely?

Comment on lines +125 to +126
- The response schema **must** be `type: object` with a single array property
with each item containing one of the requested resources.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems substantially different from the proto guidance:

  1. OAS responses only have an array, where proto responses just have to include the repeated field.
  2. The OAS array just has the requested resource; the proto repeated field has either the resource or an error object.

These both seem like they should be the same across IDLs - no?

"rating": 9.6
},
{
"code": "NotFound",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be 404 rather than "NotFound"? Or if not, where are these codes defined? Is there a standard, or is it up to each BatchGet method to define its error codes?

Comment on lines +153 to +156
- The array of resources **must** be named `results` and contain resources with
no additional wrapping.
- There must not be a `nextPageToken` field as batch get operations are not
pageable.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't seem OAS-specific - can we factor it out of the tab?


The batch get method may support a transactional form of operation where the
get either succeeds for all requested resources or fails. When supported, the
method should define a boolean parameter `asTransaction` that the user must
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think transactional might be more consistent with the general AEP style than asTransaction, since the AEPs try to avoid prepositions in field names in general. (But I don't remember if we already discussed this...)

The batch get method may support a transactional form of operation where the
get either succeeds for all requested resources or fails. When supported, the
method should define a boolean parameter `asTransaction` that the user must
specify with the value `true` to request transactional operation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
specify with the value `true` to request transactional operation.
specify with the value `true` to request a transactional operation.

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.

Adopt AIP-0231 Batch methods: Get
3 participants