Skip to content

Commit e251e8f

Browse files
committed
docs: fix accuracy issues in AGENTS.md, ARCHITECTURE.md, CONTRIBUTING.md
- AGENTS.md: clarify that .select() with fields.* requires .withContentType() first (client-side IllegalStateException, not an API error); sys-only selections have no such requirement - ARCHITECTURE.md: fix resolveLinks() description — it iterates entry content-type field definitions and looks up from the indexed maps, not "traverses the includes"; silently drops unresolved links - CONTRIBUTING.md: correct integration test setup — credentials are hardcoded in test classes, no env vars needed; clarify tests run locally only, not in CI - CONTRIBUTING.md: replace bare mvn with ./mvnw in release steps
1 parent 4208397 commit e251e8f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Read this file first. It tells you where to find context in this repo.
1919

2020
- **Link resolution order matters** — `ResourceUtils.resolveLinks()` must run after localization and raw-field capture. Never reorder the post-processing pipeline in `ResourceFactory.array()` without understanding all downstream side effects.
2121
- **Unresolved links are silent, not exceptions** — if an included entry's depth exceeds the API limit (10), unresolved links remain as placeholder objects. Code that dereferences resolved links must handle null/stub gracefully.
22-
- **`sys` fields are always present** — the SDK enforces that `sys.*` attributes are always returned (for the `select` feature, `.withContentType()` is required when using `.select()` or an API error will ensue).
22+
- **`sys` fields are always present** — the SDK enforces that `sys.*` attributes are always returned. When using `.select()` with `fields.*` selections, `.withContentType()` must be called first or the SDK throws a client-side `IllegalStateException` before the request is sent. Selecting only `sys` fields does not require a content type.
2323
- **`rawFields` is the only path to raw rich text JSON** — `TransformQuery` (unwrapping) does not expose raw rich text; use `CDAEntry.rawFields` or make a direct HTTP request.
2424
- **Cross-space token limit is 20** — `setCrossSpaceTokens()` accepts at most 20 extra spaces (21 total). Only the first level of cross-space references is resolved.
2525
- **Sync tokens are stateful and environment-aware** — passing a `SynchronizedSpace` from the wrong environment to `client.sync()` will produce incorrect deltas.

‎ARCHITECTURE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Consumers are JVM and Android applications. The SDK wraps all outbound HTTP via
4949
- `ResourceUtils.mapResources()` — indexes assets and entries by ID
5050
- `ResourceUtils.setRawFields()` — preserves the unprocessed field map for rich text access
5151
- `RichTextFactory.resolveRichTextField()` — parses rich text JSON into the `CDARich*` node tree
52-
- `ResourceUtils.resolveLinks()` — traverses the includes and replaces link stubs with the actual `CDAResource` objects (in-memory object graph)
52+
- `ResourceUtils.resolveLinks()` — iterates each entry's content-type field definitions to find Link and Array-of-Link fields, then replaces link stubs with the already-indexed `CDAResource` objects from `array.assets()` / `array.entries()` (in-memory object graph). Links not present in the index are silently dropped, not thrown as errors.
5353

5454
5. **Result** — `CDAArray` (or single `CDAResource`) is returned to the caller with fully resolved links and localized fields.
5555

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ devcontainer exec --workspace-folder . bash
4444
./mvnw -B test
4545
```
4646

47-
- **Integration tests** require a live Contentful space and environment variables — not run in CI by default.
47+
- **Integration tests** connect to live Contentful spaces using hardcoded read-only credentials (space IDs and tokens are baked into the test classes under `src/test/java/…/cda/integration/`). No environment variables are required. Integration tests are not run in CI — run them locally when you need to verify against the live API.
4848

4949
## Commit Convention
5050

@@ -80,10 +80,10 @@ Releases are on-demand and require the Contentful GPG key imported locally (obta
8080
# 2. Add -SNAPSHOT postfix to <version> in pom.xml if not already present
8181

8282
# 3. Prepare the release (prompts for release version and next snapshot version)
83-
mvn release:prepare
83+
./mvnw release:prepare
8484

8585
# 4. Perform the release (builds, signs, and publishes to Maven Central)
86-
mvn release:perform
86+
./mvnw release:perform
8787
```
8888

8989
Artifacts are published to Maven Central under `com.contentful.java:java-sdk`. Pre-releases are available via Sonatype snapshots and jitpack.io.

0 commit comments

Comments
 (0)