Skip to content

Add rfl::Nullable<T>, rfl::TriState<T>, and rfl::AddNullFields - #122

Open
clockblocker wants to merge 2 commits into
mainfrom
nullable-tristate
Open

clockblocker wants to merge 2 commits into
mainfrom
nullable-tristate

Conversation

@clockblocker

Copy link
Copy Markdown
Owner

Summary

Adds explicit wire-presence types and null-field serialization processor:

  • rfl::Nullable<T>: always serializes explicitly ("field": null when empty, rather than omitting like std::optional<T>).
  • rfl::TriState<T> + rfl::omitted: distinguishes omitted (State::omitted) vs explicit null (State::null) vs present value (State::value) for JSON-RPC, ASTs, and PATCH payloads.
  • rfl::AddNullFields processor: emits explicit null for empty nullable fields (std::optional, smart pointers, raw pointers) while respecting rfl::TriState omitted semantics, rfl::Skip / rfl::SkipSerialization, and non-nullable empty XML containers.
  • Full support across JSON, XML, Generic, CLI option unwrapping, schemaful readers/writers, move-only/non-default-constructible types, DefaultVal<TriState> / Rename<..., DefaultVal<TriState>>, and JSON Schema generation.

Verification

  • Full CTest suite under -Wall -Werror + REFLECTCPP_STRICT_WARNINGS=ON: 664/664 passed.
  • Passed Neon High Judge review (APPROVE WITH NITS).

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