Skip to content
Merged
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
72 changes: 0 additions & 72 deletions .github/workflows/release-on-branch.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env
repomix-output*
target/

.idea/
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# java.util.json Backport for JDK 21
# java.util.json Backport for Java 21 (OpenJDK sandbox)

Early access to the unstable `java.util.json` API — taken from the OpenJDK jdk-sandbox “json” branch as of 2025-09-04.
Experimental backport of the proposed `java.util.json` API from the OpenJDK jdk‑sandbox “json” branch for use on Java 21+.
This project is not an official release; APIs and behavior may change as upstream evolves.

References:
- OpenJDK sandbox “json” branch: https://github.com/openjdk/jdk-sandbox/tree/master/src/java.json
- Design paper: [Towards a JSON API for the JDK.pdf](Towards%20a%20JSON%20API%20for%20the%20JDK.pdf)

## Quick Start

Expand Down Expand Up @@ -43,7 +48,7 @@ JsonValue backToJson = Json.fromUntyped(Map.of(
));
```

## Back Port Project Goals
## Backport Project Goals

- **✅Enable early adoption**: Let developers try the unstable Java JSON patterns today on JDK 21+
- **✅API compatibility over performance**: Focus on matching the emerging "batteries included" API design rather than competing with existing JSON libraries on speed.
Expand Down Expand Up @@ -82,7 +87,7 @@ This is a simplified backport with the following changes from the original:

These vulnerabilities exist in the upstream OpenJDK sandbox implementation and are reported here for transparency.

## JSON Schema Validator
## JSON Schema Validator (2020-12)

By including a basic schema validator that demonstrates how to build a realistic feature out of the core API. To demonstrate the power of the core API, it follows Data Oriented Programming principles: it parses JSON Schema into an immutable structure of records, then for validation it parses the JSON to the generic structure and uses the thread-safe parsed schema as the model to validate the JSON being checked.

Expand All @@ -99,7 +104,7 @@ var result = schema.validate(
// result.valid() => true
```

Compatibility: we run the official 2020-12 JSON Schema Test Suite on verify; in strict mode it currently passes about 71% of applicable cases.
Compatibility: runs the official 202012 JSON Schema Test Suite on `verify`; in strict mode it currently passes about 71% of applicable cases.

## Building

Expand Down
7 changes: 4 additions & 3 deletions json-compatibility-suite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@

<parent>
<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21-parent</artifactId>
<artifactId>parent</artifactId>
<version>0.1.0</version>
</parent>

<artifactId>json-compatibility-suite</artifactId>
<packaging>jar</packaging>

<name>JSON Compatibility Suite</name>
<name>java.util.json Java21 Backport – JSON Test Suite</name>
<description>Runs the official JSON Test Suite against the java.util.json Java 21 backport to track conformance with JSON standards.</description>

<dependencies>
<dependency>
<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21</artifactId>
<artifactId>java.util.json</artifactId>
<version>${project.version}</version>
</dependency>
<!-- JUnit 5 for testing -->
Expand Down
7 changes: 4 additions & 3 deletions json-java21-api-tracker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

<parent>
<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21-parent</artifactId>
<artifactId>parent</artifactId>
<version>0.1.0</version>
</parent>

<artifactId>json-java21-api-tracker</artifactId>
<packaging>jar</packaging>

<name>API Tracker</name>
<name>java.util.json Java21 Backport Upstream API Tracker</name>
<description>Compares the OpenJDK sandbox java.util.json API to this Java 21 backport and reports differences to track upstream changes. Experimental tooling.</description>

<properties>
<maven.compiler.release>21</maven.compiler.release>
Expand All @@ -22,7 +23,7 @@
<dependencies>
<dependency>
<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21</artifactId>
<artifactId>java.util.json</artifactId>
<version>${project.version}</version>
</dependency>
<!-- JUnit 5 for testing -->
Expand Down
7 changes: 4 additions & 3 deletions json-java21-schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

<parent>
<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21-parent</artifactId>
<artifactId>parent</artifactId>
<version>0.1.0</version>
</parent>

<artifactId>json-java21-schema</artifactId>
<artifactId>java.util.json.schema</artifactId>
<packaging>jar</packaging>
<name>JSON Schema Validator</name>
<name>java.util.json Java21 Backport – JSON Schema Validator (2020-12)</name>
<description>Experimental JSON Schema 2020-12 validator built using the java.util.json Java 21 backport; includes integration tests running the official JSON Schema Test Suite.</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
7 changes: 4 additions & 3 deletions json-java21/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

<parent>
<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21-parent</artifactId>
<artifactId>parent</artifactId>
<version>0.1.0</version>
</parent>

<artifactId>json-java21</artifactId>
<artifactId>java.util.json</artifactId>
<packaging>jar</packaging>

<name>java.util.json Backport</name>
<name>java.util.json Java21 Backport</name>
<description>Backport of the OpenJDK sandbox java.util.json API adapted for Java 21+. Experimental; APIs and behavior may change as upstream evolves.</description>

<dependencies>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.simbo1905.json</groupId>
<artifactId>json-java21-parent</artifactId>
<artifactId>parent</artifactId>
<version>0.1.0</version>
<packaging>pom</packaging>

<name>java.util.json Backport Parent</name>
<description>A backport of the upcoming java.util.json API for Java 21+</description>
<name>java.util.json Java21 Backport Parent</name>
<description>Backport of the OpenJDK jdk-sandbox java.util.json sources adapted for Java 21+. Experimental and subject to change; not an official OpenJDK release.</description>
<url>https://simbo1905.github.io/java.util.json.Java21/</url>

<licenses>
Expand Down
7 changes: 7 additions & 0 deletions scripts/setup-release-secrets.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ else
fi
fi

# Also persist a key name (fingerprint) for maven-gpg-plugin selection
KEY_FPR=$(gpg --with-colons --list-secret-keys "$GPG_KEY_ID" 2>/dev/null | awk -F: '$1=="fpr"{print $10; exit}')
if [[ -n "$KEY_FPR" ]]; then
echo "Setting GPG_KEYNAME (fingerprint) for CI: $KEY_FPR"
print -r -- "$KEY_FPR" | gh secret set GPG_KEYNAME --app actions ${REPO_FLAG:+${REPO_FLAG[@]}} || true
fi

print -r -- "$GPG_PASSPHRASE" | gh secret set GPG_PASSPHRASE --app actions ${REPO_FLAG:+${REPO_FLAG[@]}}

echo "Validating secrets presence..."
Expand Down