From 1702266b75f6ef7ea5cfdfc8970bcce89489bcb3 Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Sat, 21 Mar 2026 15:56:58 +0100 Subject: [PATCH] fix: remove jsonunwrapped workaround by upgrading to micronaut-json-schema version 2.0.0-M6 --- build.gradle.kts | 12 -- gradle/libs.versions.toml | 2 +- .../schemas/sync-data-message.schema.json | 109 ------------------ .../META-INF/schemas/sync-message.schema.json | 40 ------- .../schemas/sync-story-message.schema.json | 79 ------------- 5 files changed, 1 insertion(+), 241 deletions(-) delete mode 100644 src/main/resources/META-INF/schemas/sync-data-message.schema.json delete mode 100644 src/main/resources/META-INF/schemas/sync-message.schema.json delete mode 100644 src/main/resources/META-INF/schemas/sync-story-message.schema.json diff --git a/build.gradle.kts b/build.gradle.kts index 58544920..0a3ad085 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -161,12 +161,6 @@ val compileJsonSchemas by tasks.registering(JavaCompile::class) { source = sourceSets.main.get().java include("org/asamk/signal/json/**/*.java") - // Exclude files with @JsonUnwrapped and files that reference them as that breaks - // the annotation generator - exclude("org/asamk/signal/json/JsonSyncDataMessage.java") - exclude("org/asamk/signal/json/JsonSyncStoryMessage.java") - exclude("org/asamk/signal/json/JsonSyncMessage.java") - classpath = sourceSets.main.get().compileClasspath + files(sourceSets.main.get().java.destinationDirectory) destinationDirectory.set(layout.buildDirectory.dir("classes/java/schemas")) @@ -181,12 +175,6 @@ val compileJsonSchemas by tasks.registering(JavaCompile::class) { ) doLast { - copy { - from("src/main/resources/META-INF/schemas") - into(destinationDirectory.get().dir("META-INF/schemas")) - include("*.schema.json") - } - fileTree(destinationDirectory.get().dir("META-INF/schemas").asFile) { include("*.schema.json") }.forEach { schemaFile -> diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2fa3f68e..ff560be1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] slf4j = "2.0.17" junit = "6.0.2" -micronaut-json-schema = "1.7.2" +micronaut-json-schema = "2.0.0-M6" micronaut-core = "4.9.3" [libraries] diff --git a/src/main/resources/META-INF/schemas/sync-data-message.schema.json b/src/main/resources/META-INF/schemas/sync-data-message.schema.json deleted file mode 100644 index 265f5453..00000000 --- a/src/main/resources/META-INF/schemas/sync-data-message.schema.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "sync-data-message.schema.json", - "title": "SyncDataMessage", - "type": "object", - "properties": { - "destination": { - "type": "string" - }, - "destinationNumber": { - "type": "string" - }, - "destinationUuid": { - "type": "string" - }, - "editMessage": { - "$ref": "edit-message.schema.json" - }, - "adminDelete": { - "$ref": "admin-delete.schema.json" - }, - "attachments": { - "type": "array", - "items": { - "$ref": "attachment.schema.json" - } - }, - "contacts": { - "type": "array", - "items": { - "$ref": "shared-contact.schema.json" - } - }, - "expiresInSeconds": { - "type": "integer" - }, - "groupInfo": { - "$ref": "group-info.schema.json" - }, - "isExpirationUpdate": { - "type": "boolean" - }, - "mentions": { - "type": "array", - "items": { - "$ref": "mention.schema.json" - } - }, - "message": { - "type": "string" - }, - "payment": { - "$ref": "payment.schema.json" - }, - "pinMessage": { - "$ref": "pin-message.schema.json" - }, - "pollCreate": { - "$ref": "poll-create.schema.json" - }, - "pollTerminate": { - "$ref": "poll-terminate.schema.json" - }, - "pollVote": { - "$ref": "poll-vote.schema.json" - }, - "previews": { - "type": "array", - "items": { - "$ref": "preview.schema.json" - } - }, - "quote": { - "$ref": "quote.schema.json" - }, - "reaction": { - "$ref": "reaction.schema.json" - }, - "remoteDelete": { - "$ref": "remote-delete.schema.json" - }, - "sticker": { - "$ref": "sticker.schema.json" - }, - "storyContext": { - "$ref": "story-context.schema.json" - }, - "textStyles": { - "type": "array", - "items": { - "$ref": "text-style.schema.json" - } - }, - "timestamp": { - "type": "integer" - }, - "unpinMessage": { - "$ref": "unpin-message.schema.json" - }, - "viewOnce": { - "type": "boolean" - } - }, - "required": [ - "destinationNumber", - "destinationUuid", - "timestamp" - ] -} diff --git a/src/main/resources/META-INF/schemas/sync-message.schema.json b/src/main/resources/META-INF/schemas/sync-message.schema.json deleted file mode 100644 index 3e4a7fa6..00000000 --- a/src/main/resources/META-INF/schemas/sync-message.schema.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "sync-message.schema.json", - "title": "SyncMessage", - "type": "object", - "properties": { - "blockedGroupIds": { - "type": "array", - "items": { - "type": "string" - } - }, - "blockedNumbers": { - "type": "array", - "items": { - "type": "string" - } - }, - "readMessages": { - "type": "array", - "items": { - "$ref": "sync-read-message.schema.json" - } - }, - "sentMessage": { - "$ref": "sync-data-message.schema.json" - }, - "sentStoryMessage": { - "$ref": "sync-story-message.schema.json" - }, - "type": { - "type": "string", - "enum": [ - "CONTACTS_SYNC", - "GROUPS_SYNC", - "REQUEST_SYNC" - ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/META-INF/schemas/sync-story-message.schema.json b/src/main/resources/META-INF/schemas/sync-story-message.schema.json deleted file mode 100644 index 25643d52..00000000 --- a/src/main/resources/META-INF/schemas/sync-story-message.schema.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "sync-story-message.schema.json", - "title": "SyncStoryMessage", - "type": "object", - "properties": { - "destinationNumber": { - "type": "string" - }, - "destinationUuid": { - "type": "string" - }, - "allowsReplies": { - "type": "boolean" - }, - "fileAttachment": { - "$ref": "attachment.schema.json" - }, - "groupId": { - "type": "string" - }, - "textAttachment": { - "title": "JsonStoryMessage.TextAttachment", - "type": "object", - "properties": { - "backgroundColor": { - "type": "string" - }, - "backgroundGradient": { - "title": "JsonStoryMessage.TextAttachment.Gradient", - "type": "object", - "properties": { - "angle": { - "type": "integer" - }, - "colors": { - "type": "array", - "items": { - "type": "string" - } - }, - "endColor": { - "type": "string" - }, - "positions": { - "type": "array", - "items": { - "type": "number" - } - }, - "startColor": { - "type": "string" - } - } - }, - "preview": { - "$ref": "preview.schema.json" - }, - "style": { - "type": "string" - }, - "text": { - "type": "string" - }, - "textBackgroundColor": { - "type": "string" - }, - "textForegroundColor": { - "type": "string" - } - } - } - }, - "required": [ - "destinationNumber", - "destinationUuid", - "allowsReplies" - ] -}