Skip to content

refactor(sdk): the RFC 8785 rule lives in internal/canonicaljson - #71

Merged
Fodesu merged 1 commit into
felinics:mainfrom
Fodesu:feat/sdk-canonical-internal
Sep 30, 2026
Merged

Fodesu merged 1 commit into
felinics:mainfrom
Fodesu:feat/sdk-canonical-internal

Conversation

@Fodesu

@Fodesu Fodesu commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

sdk.CanonicalJSON keeps its signature and ErrInvalidJSON keeps its identity. The RFC 8785 transform, the escaped-lone-surrogate check and the hex parser move to internal/canonicaljson, so other packages of the module can canonicalize under the same rule without importing sdk. No behaviour change; the existing sdk tests cover the moved code through CanonicalJSON.

Test plan

  • go build ./...
  • go test ./sdk/ ./internal/...
  • golangci-lint run ./sdk/... ./internal/... reports 0 issues

sdk.CanonicalJSON keeps its signature and ErrInvalidJSON its identity;
the transform, the escaped-lone-surrogate check and the hex parser move
to internal/canonicaljson so a package that must not import the SDK can
canonicalize under the same rule. Behaviour is unchanged.
@Fodesu
Fodesu merged commit b3c9350 into felinics:main Sep 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant