Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# stripe-java

## Testing

- Run all tests: `just test`
- Run a single test class: `just test-one com.stripe.net.HttpClientTest`
- Pass extra Gradle args: `just test --tests com.stripe.SomeTest`

## Formatting

- Format: `just format` (uses Spotless via Gradle)
- Format check: `just format-check`

## Key Locations

- HTTP client abstract base (retry logic): `src/main/java/com/stripe/net/HttpClient.java`
- HTTP implementation: `src/main/java/com/stripe/net/HttpURLConnectionClient.java`
- Header management: `src/main/java/com/stripe/net/HttpHeaders.java`
- Request building: `src/main/java/com/stripe/net/StripeRequest.java`
- Authentication: `src/main/java/com/stripe/net/Authenticator.java`, `BearerTokenAuthenticator.java`
- Response getter (request dispatch): `src/main/java/com/stripe/net/LiveStripeResponseGetter.java`
- Main config/version: `src/main/java/com/stripe/Stripe.java`
- Client class: `src/main/java/com/stripe/StripeClient.java`

## Generated Code

- Files containing `File generated from our OpenAPI spec` at the top are generated; do not edit. Similarly, any code block starting with `The beginning of the section generated from our OpenAPI spec` is generated and should not be edited directly.
- If something in a generated file/range needs to be updated, add a summary of the change to your report but don't attempt to edit it directly.
- Resource model classes under `src/main/java/com/stripe/model/` are largely generated.
- The `net/` package (HTTP client, headers, request/response) is NOT generated.

## Conventions

- Uses Java's built-in `HttpURLConnection` for HTTP
- Requires JDK 17 to build
- Gradle build system
- Work is not complete until `just test` passes

### Comments

- Comments MUST only be used to:
1. Document a function
2. Explain the WHY of a piece of code
3. Explain a particularly complicated piece of code
- Comments NEVER should be used to:
1. Say what used to be there. That's no longer relevant!
2. Explain the WHAT of a piece of code (unless it's very non-obvious)

It's ok not to put comments on/in a function if their addition wouldn't meaningfully clarify anything.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
startsWith(github.ref, 'refs/tags/v') &&
!contains(github.ref, 'beta') &&
!contains(github.ref, 'alpha') &&
endsWith(github.actor, '-stripe')
needs: [build, test]
runs-on: "ubuntu-24.04"
Expand Down
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e10daa4ed23a4fe87d6ea60836226446e042fdd3
055ca4f2f740418346b2ed0705251b23a5bc074a