Skip to content

fix: accept both binary and list schema keys - #22

Open
Taure wants to merge 1 commit into
novaframework:masterfrom
Taure:fix/binary-schema-keys
Open

fix: accept both binary and list schema keys#22
Taure wants to merge 1 commit into
novaframework:masterfrom
Taure:fix/binary-schema-keys

Conversation

@Taure

@Taure Taure commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

jesse expects list strings for schema keys, but Nova routes typically use binaries (e.g. ~"schemas/user.json"). This causes a function_clause crash in jesse_database:load/1 when the schema location is a binary.

Add ensure_list/1 to convert binary schema locations before passing to jesse:validate and jesse:add_schema.

Test plan

  • Tested with a Nova app using binary schema keys in routes
  • 10,000 requests at 20 concurrent workers — 0 errors, 8,381 req/sec
  • Both valid (201) and invalid (400) JSON payloads handled correctly

jesse expects list strings for schema keys, but Nova routes
typically use binaries. Add ensure_list/1 to convert binary
schema locations before passing to jesse:validate and
jesse:add_schema.
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