Skip to content

Conversation

@pengying
Copy link
Contributor

@pengying pengying commented Jan 24, 2026

TL;DR

Added a new GridError schema and improved error handling in the OpenAPI specification.

What changed?

  • Created a new GridError schema to standardize error responses
  • Added additionalProperties: true to all error schema details objects to allow for flexible error details
  • Refactored BulkCustomerImportErrorEntry to extend from GridError instead of using a nested error structure
  • Updated webhook response schemas to reference GridError instead of Error

Copy link
Contributor Author

pengying commented Jan 24, 2026

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 24, 2026

Greptile Overview

Greptile Summary

This PR standardizes error handling by introducing a new GridError schema and adding additionalProperties: true to all error details objects. The refactoring improves error schema composition, particularly for BulkCustomerImportErrorEntry which now extends GridError via allOf.

Major changes:

  • Created new GridError schema with flexible error details structure
  • Added additionalProperties: true to 10 error schemas (Error400, Error401, Error403, Error404, Error409, Error410, Error412, Error424, Error500, Error501)
  • Introduced new Error410 schema for CUSTOMER_DELETED error code
  • Refactored BulkCustomerImportErrorEntry to extend GridError instead of nesting error objects
  • Updated webhook response schemas to reference GridError instead of Error

Critical issue:

  • The PR accidentally removes Idempotency-Key parameters from /transfers/in and /transfers/out endpoints. These were just added in PR feat: adding idempotency to transfers #138, and this unintended revert is not mentioned in the PR description.

Confidence Score: 2/5

  • This PR should NOT be merged as-is due to unintended removal of idempotency support
  • While the error schema refactoring is well-structured and the additionalProperties changes are valid, the PR accidentally reverts idempotency support that was just added in PR feat: adding idempotency to transfers #138. This breaking change is not documented in the PR description and appears to be unintentional.
  • Pay critical attention to openapi/paths/transfers/transfer_in.yaml and openapi/paths/transfers/transfer_out.yaml - both files removed the Idempotency-Key parameter

Important Files Changed

Filename Overview
openapi/components/schemas/common/GridError.yaml New GridError schema created with additionalProperties enabled for flexible error details
openapi/components/schemas/customers/BulkCustomerImportErrorEntry.yaml Refactored to extend GridError with allOf, cleaner schema composition
openapi/paths/transfers/transfer_in.yaml Removed Idempotency-Key parameter - unrelated to PR title and reverts PR #138
openapi/paths/transfers/transfer_out.yaml Removed Idempotency-Key parameter - unrelated to PR title and reverts PR #138
openapi.yaml Bundled schema reflects all changes including unintended Idempotency-Key removal
mintlify/openapi.yaml Copy of bundled schema with same issues as openapi.yaml

Sequence Diagram

sequenceDiagram
    participant Client
    participant API
    participant ErrorHandler
    participant Schema
    
    Note over Client,Schema: Error Handling Flow with GridError
    
    Client->>API: Request to API endpoint
    API->>API: Process request
    
    alt Request succeeds
        API->>Client: 200 OK with response
    else Request fails (400/401/403/404/409/410/412/424/500/501)
        API->>ErrorHandler: Generate error response
        ErrorHandler->>Schema: Use GridError for webhooks
        Note over Schema: GridError schema with<br/>additionalProperties: true
        Schema-->>ErrorHandler: Flexible error structure
        ErrorHandler->>ErrorHandler: Add code, message, details
        ErrorHandler->>API: Error response object
        API->>Client: Error response with status code
    end
    
    Note over Client,Schema: Bulk Import Error Flow
    
    Client->>API: POST bulk customer import
    API->>API: Process bulk entries
    
    loop For each failed entry
        API->>ErrorHandler: Create BulkCustomerImportErrorEntry
        Note over ErrorHandler: Extends GridError via allOf<br/>Adds correlationId field
        ErrorHandler->>ErrorHandler: Add correlationId + error details
    end
    
    API->>Client: BulkCustomerImportJob response<br/>with errors array
Loading

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 6432728 to e5749d2 Compare January 27, 2026 01:29
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
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.

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 68ab09c to 5786fb9 Compare January 27, 2026 05:18
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from e5749d2 to a27f6e6 Compare January 27, 2026 05:19
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
Inconsistent error schema reference - should use GridError.yaml instead of Error.yaml to match the PR's goal of standardizing on GridError

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 5786fb9 to 79467e5 Compare January 27, 2026 05:24
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from a27f6e6 to a1379cd Compare January 27, 2026 05:24
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
Update this to reference GridError for consistency with other error responses

            $ref: ../../components/schemas/common/GridError.yaml

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 AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 79467e5 to 9f4bbd9 Compare January 27, 2026 20:38
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from a1379cd to d0f0475 Compare January 27, 2026 20:38
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
inconsistent reference - should use GridError instead of Error to match the pattern established in this PR

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from d0f0475 to 94a379a Compare January 27, 2026 21:19
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 9f4bbd9 to 4e17d69 Compare January 27, 2026 21:19
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
this should reference GridError.yaml not Error.yaml for consistency with the rest of the PR

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 4e17d69 to 5022722 Compare January 27, 2026 23:54
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 94a379a to c72b46f Compare January 27, 2026 23:54
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
reference to Error.yaml should be updated to GridError.yaml for consistency

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 99a29c9 to d8d7c4d Compare January 28, 2026 00:08
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 03ebf04 to db286da Compare January 28, 2026 00:08
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
Still references old Error.yaml instead of GridError.yaml

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from db286da to 493e9f8 Compare January 28, 2026 00:15
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from d8d7c4d to 1c31c37 Compare January 28, 2026 00:15
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Additional Comments (1)

openapi/components/schemas/common/Error.yaml
Error schema's details field is missing additionalProperties: true while all other error schemas now have it

  details:
    type: object
    description: Additional error details
    additionalProperties: true
Prompt To Fix With AI
This 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.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 493e9f8 to 34de965 Compare January 28, 2026 00:27
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch 2 times, most recently from fbf418e to 48e70c8 Compare January 28, 2026 04:32
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split branch from 34de965 to e2eb0c0 Compare January 28, 2026 04:32
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
should reference GridError.yaml instead of Error.yaml to be consistent with the PR's goal of standardizing on GridError

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 145:145

Comment:
should reference `GridError.yaml` instead of `Error.yaml` to be consistent with 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.

@pengying pengying changed the base branch from 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split to graphite-base/131 February 5, 2026 16:43
@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 48e70c8 to 00ab46b Compare February 5, 2026 16:43
@pengying pengying changed the base branch from graphite-base/131 to main February 5, 2026 16:43
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Additional Comments (1)

openapi/paths/customers/customers_{customerId}.yaml
Inconsistent error schema reference - uses old Error schema instead of GridError

The 410 response here still references ../common/Error.yaml while the PR updates other webhook responses to use GridError. The old Error schema lacks additionalProperties: true on the details object.

            $ref: ../../components/schemas/common/GridError.yaml
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/customers/customers_{customerId}.yaml
Line: 172:172

Comment:
Inconsistent error schema reference - uses old `Error` schema instead of `GridError`

The 410 response here still references `../common/Error.yaml` while the PR updates other webhook responses to use `GridError`. The old `Error` schema lacks `additionalProperties: true` on the `details` object.

```suggestion
            $ref: ../../components/schemas/common/GridError.yaml
```

How can I resolve this? If you propose a fix, please make it concise.

@pengying pengying force-pushed the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch from 00ab46b to fce8683 Compare February 5, 2026 18:00
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Additional Comments (2)

openapi/paths/transfers/transfer_in.yaml
Removed Idempotency-Key parameter that was just added in PR #138. This appears to be an unintended revert not mentioned in PR description.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/transfers/transfer_in.yaml
Line: 9:11

Comment:
Removed `Idempotency-Key` parameter that was just added in PR #138. This appears to be an unintended revert not mentioned in PR description.

How can I resolve this? If you propose a fix, please make it concise.

openapi/paths/transfers/transfer_out.yaml
Removed Idempotency-Key parameter that was just added in PR #138. This appears to be an unintended revert not mentioned in PR description.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/transfers/transfer_out.yaml
Line: 7:9

Comment:
Removed `Idempotency-Key` parameter that was just added in PR #138. This appears to be an unintended revert not mentioned in PR description.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor Author

pengying commented Feb 5, 2026

Merge activity

  • Feb 5, 8:49 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 5, 8:49 PM UTC: @pengying merged this pull request with Graphite.
  • Feb 5, 11:49 PM UTC: A user started a stack merge that includes this pull request via Graphite.

@pengying pengying merged commit c9ec7a2 into main Feb 5, 2026
6 checks passed
@pengying pengying deleted the 01-24-feat_flatten_lightningexternalaccountinfo_schema_split_split_split_split branch February 5, 2026 20:49
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.

2 participants