Skip to content

Releases: phpgt/Json

April 2026 release

21 Apr 13:35
df697c3

Choose a tag to compare

What's Changed

  • #62 Error Validation by @pixeldrift64 in #63
  • feature: error callback by @g105b in #65
  • build(deps-dev): bump phpstan/phpstan from 1.12.19 to 2.1.40 by @dependabot[bot] in #66
  • build(deps): bump justinrainbow/json-schema from 6.2.0 to 6.7.2 by @dependabot[bot] in #68
  • build(deps-dev): bump phpunit/phpunit from 10.5.45 to 10.5.62 by @dependabot[bot] in #69
  • build(deps): bump justinrainbow/json-schema from 6.7.2 to 6.8.0 by @dependabot[bot] in #71
  • gt-tidy by @g105b in #72
  • tidy: JSON casing by @g105b in #73
  • build(deps-dev): bump squizlabs/php_codesniffer from 3.11.3 to 4.0.1 by @dependabot[bot] in #67

New Contributors

Full Changelog: v2.2.0...v2.2.1

Schema Object & JsonDocumentBuilder

09 Dec 21:40
522fb4f

Choose a tag to compare

This release mainly focuses on improving type safety, handling complex JSON structures, and extending the functionality of JsonDocument and related classes.

  • Add JetBrains sponsorship to README with H1 heading by @g105b in #60
  • Schema object and json document builder by @g105b in #61

Full Changelog: v2.1.0...v2.2.0

In JsonKvpObject.php:

  • Adjusted validation logic to add support for potential null key in valid() method.

In JsonObjectBuilder.php:

  • Enhanced JSON structure validation during decoding.
  • Improved handling of complex JSON structures, including proper treatment of scalar values, associative arrays, and indexed arrays.
  • Streamlined code by replacing verbose conditional branches with modern match() syntax.
  • Introduced helper methods to process arrays and nested elements cleanly.

New File:

  • Added JsonTypeException.php to provide specific exception handling for JSON type-related errors.

In JsonDocument.php:

  • Added set() and get() methods to support dot notation for accessing and modifying nested keys.
  • Refactored code to ensure support for JsonKvpObject transformations while handling nested objects effectively.
  • Ensured proper type handling and safe traversal for nested structures with utility methods.

In JsonDocumentTest.php:

  • Refactored existing tests and added new tests to validate setObject, set() functionality (including nested keys), and construction of JSON objects from associations.

These improvements aim to make the library more robust, reduce vulnerabilities with incorrect type handling, and improve test coverage for better reliability.

Build JsonObject directly from files

01 Mar 16:19
ba557c4

Choose a tag to compare

In this release, we introduce the JsonObjectBuilder::fromFile() function that will read the provided file into the appropriate JsonObject type.

Schema validation

01 Mar 14:39
ed440a9

Choose a tag to compare

In this release, we can now automatically validate JSON objects according to a schema. This feature exists so that WebEngine applications can serve JSON API endpoints with the same effort as HTML pages.

Read the wiki for more information!

July 2023

13 Jul 13:23
8938b37

Choose a tag to compare

What's Changed

Full Changelog: v1.2.0...v1.2.1

Internal improvements and more control over json_decode

15 Sep 11:31
26b3972

Choose a tag to compare

What's Changed

  • Enforce maximum json stack depth by @g105b in #9
  • ci: upgrade scrutinizer by @g105b in #10
  • feature: internal exceptions by @g105b in #12
  • feature: pass flags to json_decode by @g105b in #14

Full Changelog: v1.1.0...v1.2.0

Throw JsonDecodeException, plus various improvements

14 Sep 15:46
a2e80b7

Choose a tag to compare

What's Changed

  • static analysis improvements by @g105b in #1
  • build: hard dependencies by @g105b in #2
  • maintenance: dependabot by @g105b in #4
  • feature: throw correct exceptions by @g105b in #6

New Contributors

  • @g105b made their first contribution in #1

Full Changelog: v1.0.0...v1.1.0

v1 release

15 Mar 18:16

Choose a tag to compare

Following on from the v1 release of PHP.Gt/DataObject earlier today, PHP.Gt/Json is now able to have its first stable release made.

No new functionality has been introduced since the last pre-release, only the upgraded dependency.

Have fun and stay productive!

All JSON compatibility added

19 Jan 10:17

Choose a tag to compare

Pre-release

It's possible to use all types of JSON object/primitive with this library now. There are more tests required and possibly some extra functionality to add before v1, but for now it will be included in the Fetch repository for real-world testing.