Skip to content
Prev Previous commit
Next Next commit
docs: correct stale facts in AGENTS.md
The Java version claimed 17+ while every profile compiles with --release 9, the
pinned version had drifted four release candidates behind, and the request
recipe still told agents to add a @JsonDeserialize annotation.

Adds a note on how model objects are deserialized now, since that changes what
adding a field to one costs.
  • Loading branch information
dargmuesli committed Sep 1, 2026
commit 57f383711c3ca68b89b9b9be1c284c7c22e2da2c
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ This file provides context for AI coding agents working in this repository.

- **Group ID:** `se.michaelthelin.spotify`
- **Artifact ID:** `spotify-web-api-java`
- **Current Version:** `10.0.0-RC1`
- **Build Tool:** Maven (`pom.xml`)
- **Java Version:** 17+
- **Java Version:** compiled with `--release 9`; CI builds on JDK 17 and 25

## Repository Structure

Expand Down Expand Up @@ -49,7 +48,6 @@ Create `src/main/java/se/michaelthelin/spotify/requests/data/<category>/<Endpoin

Key patterns:
- Extend `AbstractDataRequest<ReturnType>` (or `AbstractDataPagingRequest` for paginated results).
- Annotate with `@JsonDeserialize(builder = <ClassName>.Builder.class)`.
- Implement `execute()` which calls `getJson()`, `postJson()`, `putJson()`, or `deleteJson()` as appropriate.
- Add a `static final class Builder` with:
- Path parameters set via `setPathParameter("key", value)`
Expand Down Expand Up @@ -104,6 +102,10 @@ mvn test -Dtest="*Playlist*"

## Key Conventions

- **Model objects are deserialized reflectively** by the shared Gson in
`model_objects/ModelObjectGson.java`, so a new field needs no parsing code.
Add `@SerializedName` only when the wire name is not the snake_case form of the field,
and add a type adapter only for a shape reflection cannot express.
- **Trailing underscores** on Java-reserved words: e.g., `public_` for the `public` field.
- **Assertions** in tests are imported from both JUnit 5 (`org.junit.jupiter.api.Assertions`) and the project's own `se.michaelthelin.spotify.Assertions`.
- **Nullable fields** from the API should be tested with `assertNull(...)` when the fixture returns `null`.
Expand Down