-
Notifications
You must be signed in to change notification settings - Fork 3
feat: rename Error to GridError and add additionalProperties to error schemas #131
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
base: 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Greptile OverviewGreptile SummaryThis PR introduces a new Key Changes
ImpactThe changes are backward-compatible in terms of response structure. The addition of Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/GridError.yaml | New GridError schema created with code, message, and details fields; includes additionalProperties: true for flexible error details |
| openapi/components/schemas/customers/BulkCustomerImportErrorEntry.yaml | New schema extending GridError to include correlationId for tracking failed bulk import entries |
| openapi/components/schemas/customers/BulkCustomerImportJob.yaml | Refactored to use BulkCustomerImportErrorEntry reference instead of inline nested error structure |
| openapi/components/schemas/webhooks/IncomingPaymentWebhookForbiddenResponse.yaml | Updated to extend GridError instead of Error for webhook forbidden responses |
| openapi/components/schemas/webhooks/IncomingPaymentWebhookUnprocessableResponse.yaml | Updated to extend GridError instead of Error for webhook unprocessable responses |
Sequence Diagram
sequenceDiagram
participant API as Grid API
participant Schema as Error Schemas
participant Client as API Client
Note over API,Client: Error Response Flow
Client->>API: API Request (e.g., POST /customers)
alt Invalid Input (400)
API->>Schema: Generate Error400
Schema->>Schema: Include code, message, details (additionalProperties: true)
Schema-->>API: Error Response
API-->>Client: 400 Error Response
end
alt Webhook Error Handling
API->>Schema: Generate GridError-based Response
Note over Schema: IncomingPaymentWebhookForbiddenResponse<br/>or IncomingPaymentWebhookUnprocessableResponse
Schema->>Schema: Extends GridError (code, message, details)
Schema->>Schema: Add specific fields (reason/requiredFields)
Schema-->>API: Webhook Error Response
API-->>Client: Webhook Error Response
end
alt Bulk Import Errors
API->>Schema: Generate BulkCustomerImportErrorEntry
Schema->>Schema: Extends GridError (code, message, details)
Schema->>Schema: Add correlationId
Schema-->>API: Error Entry with correlationId
API-->>Client: Bulk Import Job with errors array
end
Note over Schema: GridError provides base schema<br/>with flexible details object
6432728 to
e5749d2
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
Incomplete migration: still references `Error.yaml` instead of `GridError.yaml`. For consistency with the rest of this PR, this should be updated to use `GridError.yaml`.
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
How can I resolve this? If you propose a fix, please make it concise. |
68ab09c to
5786fb9
Compare
e5749d2 to
a27f6e6
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
Inconsistent error schema reference - should use `GridError.yaml` instead of `Error.yaml` to match the PR's goal of standardizing on `GridError`
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
How can I resolve this? If you propose a fix, please make it concise. |
5786fb9 to
79467e5
Compare
a27f6e6 to
a1379cd
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
Update this to reference `GridError` for consistency with other error responses
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
79467e5 to
9f4bbd9
Compare
a1379cd to
d0f0475
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
inconsistent reference - should use `GridError` instead of `Error` to match the pattern established in this PR
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
How can I resolve this? If you propose a fix, please make it concise. |
d0f0475 to
94a379a
Compare
9f4bbd9 to
4e17d69
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
this should reference `GridError.yaml` not `Error.yaml` for consistency with the rest of the PR
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
How can I resolve this? If you propose a fix, please make it concise. |
4e17d69 to
5022722
Compare
94a379a to
c72b46f
Compare
c72b46f to
99a29c9
Compare
5022722 to
03ebf04
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
reference to `Error.yaml` should be updated to `GridError.yaml` for consistency
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
How can I resolve this? If you propose a fix, please make it concise. |
99a29c9 to
d8d7c4d
Compare
03ebf04 to
db286da
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145
Comment:
Still references old `Error.yaml` instead of `GridError.yaml`
```suggestion
$ref: ../../components/schemas/common/GridError.yaml
```
How can I resolve this? If you propose a fix, please make it concise. |
db286da to
493e9f8
Compare
d8d7c4d to
1c31c37
Compare
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.
1 file reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/common/Error.yaml
Line: 9:11
Comment:
`Error` schema's `details` field is missing `additionalProperties: true` while all other error schemas now have it
```suggestion
details:
type: object
description: Additional error details
additionalProperties: true
```
How can I resolve this? If you propose a fix, please make it concise. |
493e9f8 to
34de965
Compare
1c31c37 to
fbf418e
Compare

TL;DR
Added a new
GridErrorschema and improved error handling in the OpenAPI specification.What changed?
GridErrorschema to standardize error responsesadditionalProperties: trueto all error schemadetailsobjects to allow for flexible error detailsBulkCustomerImportErrorEntryto extend fromGridErrorinstead of using a nested error structureGridErrorinstead ofError