Skip to content

rfl::json::to_schema: flatten nested anyOf for std::optional<std::variant<...>> #109

Done

Description

@clockblocker

Bug

rfl::json::to_schema emits redundant nested anyOf arrays (e.g., anyOf: [{ anyOf: [...] }, { type: "null" }]) for std::optional<std::variant<...>> instead of a flat anyOf containing the variant branches plus null.

Evidence

  • Surfaced in osmium-tool#3 Showcase Migration.

Acceptance Criteria

  • Flatten nested anyOf when generating JSON Schema for std::optional<std::variant<...>> (and equivalent rfl::Variant optional wrappers).
  • Add unit tests verifying clean flat anyOf Draft 2020-12 output.

Activity

  1. added
    bug
    ready-for-agent
    on Nov 27, 2026
  2. clockblocker commented on Nov 27, 2026

    @clockblocker
    OwnerAuthor

    Resolved on showcase/all-lanes via Batch 1 merge 4861aafd (commits d4700190, d3673b24). Verified with 962/962 CTest passing under AppleClang 17 -Wall -Werror + REFLECTCPP_STRICT_WARNINGS=ON (non-SYSTEM -I for internal tests, -isystem for downstream consumers) and dual Judge approval (Gemini 4 Neon High: APPROVE WITH NITS, all addressed; Claude Opus 5.5 High re-check: APPROVE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions