Repository navigation
feat(schema): add opt-in zero-bloat rfl::Metadata<T> for out-of-band field/struct documentation - #119
Open
clockblocker wants to merge 3 commits into
Open
clockblocker wants to merge 3 commits into
clockblocker wants to merge 3 commits into
Conversation
…field/struct documentation
…tadata, empty Deprecated description, Cap'n Proto literal unwrap) and nits
… alternative has no description
This was referenced Nov 27, 2026
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
Stacked on #118. Adds opt-in out-of-band struct and field metadata via
rfl::Metadata<T>so large structs can attach JSON Schema descriptions and deprecation notices without embedding longStringLiteraltemplate arguments into every field's C++ type.Example
Compile-time & binary impact
48-field
ConfigDatawith 48 full-sentence field descriptions (AppleClang 17 arm64):-O0 -gDebug).osizemain(inlinerfl::Description)#118(inlinerfl::Description)rfl::Metadata<T>)Key details
to_schema()— zero impact on struct layout,read, orwrite.fieldsanddescriptionaccept eitherstatic constexprvalues orstaticfunctions returning borrowed views (so definitions can live out-of-line in a.cpp; dangling by-value containers are rejected viastatic_assert).SnakeCaseToCamelCase,Rename,Flatten,TaggedUnionalternatives, andReflector<T>types).Type::Deprecatedin JSON Schema so empty deprecation descriptions don't overwrite innerrfl::Descriptionor emit"description": "", and unwrapsDescription/Deprecatedcleanly in Avro and Cap'n Proto schema emitters.AI-authored.