Skip to content

Add SchemaName, SchemaExtension, IntegerBounds, TupleBounds, OmitEmptyRequired, and flattened optional<variant> anyOf - #121

Open
clockblocker wants to merge 2 commits into
mainfrom
schema-ext-and-bounds
Open

clockblocker wants to merge 2 commits into
mainfrom
schema-ext-and-bounds

Conversation

@clockblocker

Copy link
Copy Markdown
Owner

Summary

Adds opt-in JSON Schema customization and Draft 2020-12 polish:

  • rfl::SchemaName<T> (static constexpr std::string_view value or static std::string value()) for clean $defs names.
  • rfl::SchemaExtension<T> for per-type title, examples, x-* extensions, and inline_schema (without bypassing Literal or Validator constraints).
  • rfl::IntegerBounds processor emitting signed/unsigned integer width bounds (minimum/maximum) for fixed-width integer types.
  • rfl::TupleBounds processor emitting Draft 2020-12 minItems/maxItems alongside prefixItems for fixed-size tuples.
  • rfl::OmitEmptyRequired processor omitting empty "required":[] arrays.
  • Flattened std::optional<std::variant<...>> anyOf schema representation (deduplicating "type":"null").
  • Normalized "type"-before-"default" property ordering; preserves ABI compatibility on legacy to_schema_internal_schema overload.
  • Exhaustive Type::BoundedInteger / Type::Annotated handling across JSON, Avro, and Cap'n Proto schema emitters.

Verification

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

…yRequired, and flattened optional<variant> anyOf
… Validator before inline_schema, hoist apply_schema_annotations, and clean up 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