-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Richard Frankel <[email protected]>
@rofrankel Please re-review. |
Co-authored-by: Richard Frankel <[email protected]>
@rofrankel Thanks for the re-review. I addressed your comments and asked for a new review. |
I made the updates we discussed three weeks ago. Please re-review and let me know if there is any additional feedback. |
- 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This language is exactly the same as the AIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a little vague as to what this term means - I think it means "document" here.
- The parameter **should** identify the [resource type](./paths) that it | |
- The documentation for the parameter **should** include the [resource type](./paths) that it |
But either way we can follow-up on this, I don't think it's a blocker.
- 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from the statement in the original AIP:
The comment for the field should document the resource pattern.
So this could mean in the description for the parameter or it could be more formal like a "pattern" keyword in the schema of the parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's two options here:
- leave it as is, since it's a generic description of the operation.
- remove this guidance and move it into protocol-specific descriptions, so we can tie it with precise recommendations.
I'm comfortable with either.
aep/general/0231/aep.md.j2
Outdated
- The response schema **must** be `type: object` with a single array property | ||
with each item containing one of the requested resources. |
There was a problem hiding this comment.
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:
- OAS responses only have an array, where proto responses just have to include the repeated field.
- 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be the same. I think the OAS description is what we want. I'll gladly fix the proto description if someone can tell me what it should be.
@rofrankel Thanks for the comments. I've addressed or answered all that I could. I will need help on the proto definition of the response. I will tag you for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all the work! The page doesn't seem to render for me today, so I think that change should be made at least.
The rest are pretty minor, and I'll watch this PR closely on replies so we can resolve them quickly. Thank you!
|
||
{% tab oas %} | ||
|
||
{% sample 'batchget.oas.yaml', 'paths./publishers/{publisherId}/books:BatchGet.get.responses.200.content.application/json' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% sample 'batchget.oas.yaml', 'paths./publishers/{publisherId}/books:BatchGet.get.responses.200.content.application/json' %} | |
{% sample 'batchget.oas.yaml', 'paths./publishers/{publisherId}/books:BatchGet' %} |
This is broken for me - I get a template syntax error. The site-generator matching is pretty rudimentary, I think it only does a substring match of some kind. Something to look into CC @rambleraptor, but the only blocker is the breaking of rendering.
pattern: | ||
|
||
- The request **must** include an array field which accepts the resource paths | ||
specifying the resources to retrieve. The field **should** be named `paths`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifying the resources to retrieve. The field **should** be named `paths`. | |
specifying the resources to retrieve. The field **must** be named `paths`. |
Is there a good reason to not require it be named paths?
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a little vague as to what this term means - I think it means "document" here.
- The parameter **should** identify the [resource type](./paths) that it | |
- The documentation for the parameter **should** include the [resource type](./paths) that it |
But either way we can follow-up on this, I don't think it's a blocker.
- Other parameters besides `paths` **may** be "hoisted" from the [standard Get | ||
request][get-request]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Other parameters besides `paths` **may** be "hoisted" from the [standard Get | |
request][get-request]. |
I don't think this is explained very well - and I think removing unclear guidance is better than including it? we can re-add with a clearer description.
I don't see any documented additional parameters in the Get, so not sure if the guidance is even relevant: https://aep.dev/131/
- The `paths` parameter **must** be a query parameter which accepts an array of | ||
resource paths specifying the resources to retrieve. The parameter **should** | ||
be named `paths`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The `paths` parameter **must** be a query parameter which accepts an array of | |
resource paths specifying the resources to retrieve. The parameter **should** | |
be named `paths`. | |
- The `paths` parameter **must** be a query parameter which accepts an array of | |
resource paths specifying the resources to retrieve. |
The guidance around the naming of the field already exists above - so remove the redundant one for conciseness?
|
||
### Response | ||
|
||
The response for a batch get method **should** be specified with the following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response for a batch get method **should** be specified with the following | |
The response for a batch get method **must** be specified with the following |
Feels weird to have a should that includes multiple musts. Why not enforce the pattern?
the paths in the request. | ||
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There must not be a `nextPageToken` field as batch get operations are not | |
- There **must not** be a `nextPageToken` field as batch get operations are not |
|
||
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 `transactional` that the user must |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method should define a boolean parameter `transactional` that the user must | |
method must define a boolean parameter `transactional` that the user must |
If we don't require that - it might be difficult for clients to understand the purpose of the value and use it.
Or we could require an annotation to specify this is the "transactional" parameter?
- The parameter **should** identify the [resource type](./paths) that it | ||
references. | ||
- The parameter should define the pattern of the resource path values. | ||
- The parameter should define the maximum number of paths allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we just update it to specify documentation? we could even qualify it in the way you described - if the protocol / description supports a way to describe it, use that. Otherwise use documentation.
- 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's two options here:
- leave it as is, since it's a generic description of the operation.
- remove this guidance and move it into protocol-specific descriptions, so we can tie it with precise recommendations.
I'm comfortable with either.
Adopt AEP 231 - Batch Get
🍱 Types of changes
What types of changes does your code introduce to AEP? Put an
x
in the boxesthat apply
📋 Your checklist for this pull request
Please review the AEP Style and Guidance for
contributing to this repository.
General
references AEPs
correctly.
(usually
prettier -w .
)Additional checklist for a new AEP
guidelines are met.
Document structure
guidelines are met.
💝 Thank you!