patch(Long id, AccountPatch patch) {
AccountDto merged = new AccountDto(id,
assigned.containsKey("name") ? (String) assigned.get("name") : cur.name(),
assigned.containsKey("tokenHash") ? (String) assigned.get("tokenHash") : cur.tokenHash(),
- assigned.containsKey("pinHash") ? (String) assigned.get("pinHash") : cur.pinHash());
+ assigned.containsKey("pinHash") ? (String) assigned.get("pinHash") : cur.pinHash(),
+ assigned.containsKey("role") ? (String) assigned.get("role") : cur.role());
rows.set(i, merged);
return Optional.of(merged);
}
diff --git a/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/generated/InMemoryAuthorRepositorySource.java b/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/generated/InMemoryAuthorRepositorySource.java
index 7027381627..a4c01db44c 100644
--- a/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/generated/InMemoryAuthorRepositorySource.java
+++ b/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/generated/InMemoryAuthorRepositorySource.java
@@ -100,7 +100,11 @@ public AuthorDto create(AuthorDto dto) {
// Issue #203 / ADR-0045: the generated controller already stamped @autoSet via
// AuthorDto.stampForInsert(dto) before calling create — the repo just persists
// the incoming (already-stamped) values verbatim.
- AuthorDto saved = new AuthorDto(nextId.getAndIncrement(), dto.name(), dto.bio(),
+ // A naive adopter repository: it trusts the id it is handed and mints one only when
+ // absent, so a client id the controller forwarded would be stored (and the shared
+ // input-server-owned-dropped scenario would see it).
+ Long id = dto.id() != null ? dto.id() : Long.valueOf(nextId.getAndIncrement());
+ AuthorDto saved = new AuthorDto(id, dto.name(), dto.bio(),
dto.createdAt(), dto.issuedCurrency(), dto.autoCreatedAt(), dto.autoUpdatedAt());
rows.add(saved);
return saved;
diff --git a/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/GeneratedTphControllerHarness.java b/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/GeneratedTphControllerHarness.java
index dbe315f4f9..22ad1739cd 100644
--- a/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/GeneratedTphControllerHarness.java
+++ b/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/GeneratedTphControllerHarness.java
@@ -115,7 +115,10 @@ public Instant deserialize(JsonParser p, DeserializationContext ctx)
this.mapper = new ObjectMapper()
.registerModule(new JavaTimeModule())
.registerModule(utcInstant)
- .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
+ // Spring Boot's default: an undeclared request key is ignored, not a 400. The generated
+ // controller leaves this to the host's mapper; the corpus pins the Boot behaviour.
+ .disable(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
Path srcDir = genDir.resolve("src");
Path classesDir = genDir.resolve("classes");
Files.createDirectories(srcDir);
diff --git a/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/InMemoryAuthRepositorySource.java b/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/InMemoryAuthRepositorySource.java
index 4f540110eb..f8343cbb49 100644
--- a/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/InMemoryAuthRepositorySource.java
+++ b/server/java/integration-tests/src/test/java/com/metaobjects/integration/api/tph/generated/InMemoryAuthRepositorySource.java
@@ -15,8 +15,8 @@
*
* The base {@code AuthDto} is the UNION of all subtype columns (the TPH-base DTO shape), so a
* single record type backs both polymorphic and per-subtype rows. Discriminator scoping is a plain
- * {@code type.equals(discriminator)} filter; a create injects the URL-supplied discriminator and
- * never reads {@code dto.type()}.
+ * {@code type.equals(discriminator)} filter; a create stores whatever id/discriminator the DTO carries,
+ * falling back to the URL's discriminator.