Skip to content

rfl::xml: unwrap std::optional in is_attribute_v and treat Attribute<std::optional<T>> as optional in JSON Schema #107

Done

Description

@clockblocker

Bug

  1. is_attribute_v fails to detect rfl::Attribute<T> when wrapped in std::optional<rfl::Attribute<T>>.
  2. rfl::Attribute<std::optional<T>> is not treated as optional during JSON Schema generation (incorrectly marked required).

Evidence

  • Surfaced in cppcheck#3 Showcase Migration.

Acceptance Criteria

  • Unwrap std::optional in is_attribute_v so std::optional<rfl::Attribute<T>> is recognized as an XML attribute.
  • Treat rfl::Attribute<std::optional<T>> as optional (omitted from required and nullable/optional) in rfl::json::to_schema.
  • Add unit tests covering both XML read/write and JSON Schema emission for both nesting orders.

Activity

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

    @clockblocker
    OwnerAuthor

    Exact file/line root causes and minimal fix plan on showcase/all-lanes (3d6a95b2) are now documented in Audit rfl::xml 7-gap surface from cppcheck#3 (see Gap #2 and Clean Action Split → Ticket 2: include/rfl/internal/is_attribute.hpp:11-22, include/rfl/Attribute.hpp:21-24, include/rfl/parsing/NamedTupleParser.hpp:276-292, include/rfl/parsing/Parser_default.hpp:592-596,661-664, and src/rfl/json/to_schema.cpp:37-55,296-301).

  3. 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