feat: replace thoas with Erlang/OTP json module#366
Open
Conversation
Remove the thoas dependency and use the built-in json module from
OTP 27+ for all JSON encoding/decoding. This removes the json_lib
configuration option since OTP json is always available.
Key changes:
- Replace all thoas:encode/1 calls with json:encode/1
- Replace thoas:decode/1 (returns {ok, Term}) with json:decode/1
(returns Term directly, throws on error) in nova_request_plugin
- Convert charlist values to binaries in nova_error_controller since
OTP json encodes charlists as JSON arrays, not strings
- Add ensure_json_safe/1 helper for CrashInfo values
- Update all tests for json module API differences
- Remove json_lib from configuration docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OTP 27+ is now required since the json module is used for JSON encoding/decoding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump actions/cache from v4 to v5 - Bump actions/checkout from v4 to v6 in release workflow - Bump OTP matrix from 27.1/28.0 to 27.3/28.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
erlef/setup-beam@v1 still uses node20 which is deprecated June 2026. Set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 to opt in early. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thoasdependency in favor of the built-injsonmodule from OTP 27+json_libconfiguration option (OTP json is always available)json:decode/1returns term directly (vsthoas:decode/1returning{ok, Term})Changes
json:encode/1directlytry json:decode/1with catch (replacescase thoas:decode/1with{ok, _}match)json:encode/1directly, update test assertionsjson:encode/1, addensure_json_safe/1for CrashInfo values, convert hardcoded strings to binariesjson:encode/1, removejson_libenv setupBreaking changes
json_libapplication env option is no longer supportedTest plan
🤖 Generated with Claude Code