Skip to content

feat: improve metadata size constraints for json-ld#1

Open
buuhuu wants to merge 3 commits intomainfrom
fix-jsonld-remove-whitespaces
Open

feat: improve metadata size constraints for json-ld#1
buuhuu wants to merge 3 commits intomainfrom
fix-jsonld-remove-whitespaces

Conversation

@buuhuu
Copy link
Copy Markdown
Contributor

@buuhuu buuhuu commented Jan 14, 2026

So far the metadata size assertion was checked against the pretty-printed version of the given json-ld. The pretty-printing may add a significant amount of whitespaces which reduce the actual amount of data that can be put into the json-ld. We had one example where the given json-ld string was 99.5k characters long and the pretty printed version 130k (+30%).

With this change I changed the order of the asserts to:

  • first assert the metadata size, and then
  • assert a valid json

I preserved the pretty printing to keep whitespaces in the json-ld string and have it line-break in the grid table. This avoids other cells to contain too many white spaces when the json-ld string has no other whitespace that would allow a line break.

I also made the maximum metadata size configureable as opts.maxMetadataSize

@buuhuu buuhuu changed the title feat: soften metadata size constraints for json-ld feat: improve metadata size constraints for json-ld Jan 14, 2026
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.

3 participants