Repository navigation
feat(metadata): include constant literals and export typing - #274
Merged
Hamilton Chapman (hamchapman) merged 2 commits intoNov 3, 2026
Merged
Hamilton Chapman (hamchapman) merged 2 commits into
Hamilton Chapman (hamchapman) merged 2 commits into
Conversation
Hamilton Chapman (hamchapman)
force-pushed
the
hc/ffi-metadata-constants
branch
2 times, most recently
from
November 2, 2026 16:22
a3810b1 to
cba958a
Compare
Hamilton Chapman (hamchapman)
force-pushed
the
hc/ffi-metadata-constants
branch
from
November 2, 2026 16:54
cba958a to
0e9d065
Compare
Hamilton Chapman (hamchapman)
marked this pull request as ready for review
November 2, 2026 16:55
Hamilton Chapman (hamchapman)
requested a review
from Daniel Henry-Mantilla (danielhenrymantilla)
November 2, 2026 16:55
Daniel Henry-Mantilla (danielhenrymantilla)
approved these changes
Nov 2, 2026
Comment on lines
+484
to
+486
| '"' => quoted.push_str("\\\""), | ||
| '\\' => quoted.push_str("\\\\"), | ||
| '\u{0}'..='\u{1f}' => quoted.push_str(&format!("\\u{:04x}", character as u32)), |
Collaborator
There was a problem hiding this comment.
I'd suggest we use r#"…"# strings for readability:
Suggested change
| '"' => quoted.push_str("\\\""), | |
| '\\' => quoted.push_str("\\\\"), | |
| '\u{0}'..='\u{1f}' => quoted.push_str(&format!("\\u{:04x}", character as u32)), | |
| '"' => quoted.push_str(r#"\""#), | |
| '\\' => quoted.push_str(r#"\\"#), | |
| '\u{0}'..='\u{1f}' => quoted.push_str(&format!(r#"\u{:04x}"#, character as u32)), |
| safer-ffi.features = ["internal-tests"] | ||
| rand = "0.9.0" | ||
| serde_test = { version = "1.0.177" } | ||
| serde_json = "1" |
Collaborator
There was a problem hiding this comment.
Suggested change
| serde_json = "1" | |
| serde_json = "1.0.154" |
Hamilton Chapman (hamchapman)
merged commit Nov 3, 2026
e9e9b46
into
getditto:master
207 checks passed
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
JSON metadata records constant names and types but omits their values, forcing binding generators to get to the values via a secondary mechanism .
This change means we now include
valueLiteralandhasExplicitTypeso generators can reproduce the constant outputs directly from metadata.Literal spellings are JSON strings, preserving large integers and the existing
Debugrepresentation. JSON escaping handles control characters and Unicode. Existing metadata consumers that reject unknown fields must accept the new fields before adopting this change; C/C#/Lua output is unchanged.