Skip to content

Releases: ProjectSky/sm-ext-json

Rebuild to match V9 extension API

Choose a tag to compare

@ProjectSky ProjectSky released this 09 Jul 19:54
d404107
Merge pull request #11 from Mikusch/main

Build against both SourceMod 1.12 (API v8) and 1.13 (API v9)#

1.1.5e

Choose a tag to compare

@ProjectSky ProjectSky released this 21 Nov 14:37

Full Changelog: 1.1.4a...1.1.5e

Release 1.1.4a

Choose a tag to compare

@github-actions github-actions released this 20 Oct 13:05

refactor: reduce code duplication and fix documentation

Code Refactoring:

  • Add CreateAndReturnHandle helper for direct return functions
  • Add CreateAndAssignHandle helper for output parameter functions

Fixes:

  • Fix json_doc_write_to_str off-by-one error in return value
  • Fix json_val_get_read_size to correctly add null terminator

CI:

  • Deprecate pushbuild.txt trigger method

Release 1.1.4

Choose a tag to compare

@github-actions github-actions released this 17 Oct 07:22

feat: Implement IYYJSONManager interface for external extensions (implements #6)

Add utility methods to make the interface more
convenient for external C++ extensions (WebSocket, HTTP, etc.).

Changes:

  • Add new interface methods for external extensions:

    • Release(YYJSONValue*): safely release JSON value objects
    • GetHandleType(): get YYJSON handle type for cross-extension access
    • GetFromHandle(): read YYJSONValue from SourceMod handle
    • ...
  • Update yyjson library to version 0.12.0

  • Fix handle permissions to allow cross-extension read access:

    • Set HandleAccess_Read = 0 in extension.cpp

These improvements enable external extensions to:

  • Use more concise API calls with sensible defaults
  • Access JSON handles across extension boundaries
  • Safely manage YYJSONValue object lifetime
  • Avoid dependency on YYJSON extension internals

All changes are backward compatible. Existing code continues to work
without modification.

Release 1.1.3

Choose a tag to compare

@github-actions github-actions released this 07 Jun 13:36

feat: enhance JSON pointer error messages with path info

  • Add path parameter to all JSON pointer error messages
  • Update yyjson library to version 0.11.1
  • Improve debugging experience by showing exact path in error logs

Release 1.1.2rc

Choose a tag to compare

@github-actions github-actions released this 22 Apr 12:39

fix: correct path resolution in deep copied JSON documents (fixes #4)

When creating a new document from a subtree using DeepCopy, paths were not
resolving correctly because the copied value was not properly set as the root
of the new document.

Changes:

  • Add yyjson_mut_doc_set_root call in json_doc_copy_deep
  • Ensure copied value becomes the new document root
  • Fix path resolution relative to new root

This fixes issues where JSON pointer operations (Ptr* functions) were not
working correctly on deep copied subtrees, as they were still referencing
the original document structure instead of treating the copied value as
the new root.

vendor: update yyjson to latest and add fp comparison patch

  1. Update yyjson library to latest version

    • Update third_party/yyjson/yyjson.h
    • Update third_party/yyjson/yyjson.c
    • Sync with upstream changes and improvements
  2. Apply floating-point comparison patch:

    • Add new API functions in yyjson.h:
    • yyjson_equals_fp Compare with default epsilon values
    • yyjson_equals_fp_custom Compare with custom epsilon values
    • Implement functions in yyjson.c
    • Update unsafe_yyjson_num_equals to use new comparison logic

The patch improves floating-point comparison accuracy by using both
relative and absolute epsilon values to handle edge cases.

Patch file: third_party/yyjson/add-floating-point-equality-comparison.patch

Release 1.1.2a

Choose a tag to compare

@github-actions github-actions released this 18 Apr 10:51

fix: json value pack and doc parse issues

  • Fix missing root value setting in json_val_pack
  • Fix incorrect read flag parameter in json_doc_parse (fixes #3)

docs: Update comments in yyjson.inc for better clarity and consistency

  • update JSON parsing error handling and improve documentation

Release 1.1.2

Choose a tag to compare

@github-actions github-actions released this 21 Mar 14:12

feat: add PtrTry* functions (implements #2)

  • Add PtrTry* functions that similar to PtrGet* but don't throw exceptions on failure, allowing for manual exception handling
  • Replace custom sorting with std::shuffle for better randomization
  • *GetInt64 functions now use signed integers
  • Add type checking methods: IsUint, IsSint, IsNum, IsTrue, IsFalse, IsCtn
  • Add immutable doc support for YYJSON.Get* functions

fix: add buffer size checks for GetString functions (fixes #1)

  • Fix Windows compilation warnings (C4244, C4267) using static casts
  • Fix *GetString functions to properly check buffer size, now throw exceptions with required size info
  • Fix *GetLength functions to correctly calc for null terminators

docs: improve documentation and comments

Release 1.1.1

Choose a tag to compare

@github-actions github-actions released this 24 Feb 13:02

feat: add Pack and FromStrings features

Add two new features for JSON manipulation:

  1. Pack: create JSON with format string and values
  2. FromStrings: create JSON from string arrays

Implementation includes:

  • Add Pack function for format string parsing
  • Add FromStrings methods for Object and Array
  • Add test cases in yyjson_test.sp
  • Add usage examples in README.md

Release 1.1.0

Choose a tag to compare

@github-actions github-actions released this 04 Feb 10:35

ver 1.1.0
fix: fix float comparison and update yyjson

  • Fix float comparison in Equals function

    • Uses epsilon comparison for reliable float equality checks
  • Update yyjson to latest version

    • See yyjson changelog for details
  • Documentation improvements

    • Clarify JSON Pointer usage
  • Minor code improvements

    • Remove redundant areClose function
    • Update float comparison in array functions