Skip to content

Validator asserts on schema-valid SPEC-OBJECT with absent optional VALUES #233

Closed

Description

@elasticdotventures

Version: reqif 0.0.48, Python 3.10.16.

A ReqIF document can omit SPEC-OBJECT/VALUES (minOccurs=0 in the packaged ReqIF XSD). The CLI validator parses before schema validation and raises AssertionError in SpecObjectParser.parse at line 41 (assert attributes is not None) on that document.

Reproduce: save the following as baseline.reqif and run reqif validate --use-reqif-schema baseline.reqif.

<?xml version="1.0" encoding="UTF-8"?>
<REQ-IF xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd"><THE-HEADER><REQ-IF-HEADER IDENTIFIER="header"><CREATION-TIME>2026-10-08T00:00:00Z</CREATION-TIME><REQ-IF-TOOL-ID>fixture</REQ-IF-TOOL-ID><REQ-IF-VERSION>1.0</REQ-IF-VERSION><SOURCE-TOOL-ID>fixture</SOURCE-TOOL-ID><TITLE>Unicode λ and CRLF</TITLE></REQ-IF-HEADER></THE-HEADER><CORE-CONTENT><REQ-IF-CONTENT><SPEC-TYPES><SPEC-OBJECT-TYPE IDENTIFIER="type_req" LAST-CHANGE="2026-10-08T00:00:00Z"/></SPEC-TYPES><SPEC-OBJECTS><SPEC-OBJECT IDENTIFIER="req_λ" LAST-CHANGE="2026-10-08T00:00:00Z"><TYPE><SPEC-OBJECT-TYPE-REF>type_req</SPEC-OBJECT-TYPE-REF></TYPE></SPEC-OBJECT><SPEC-OBJECT IDENTIFIER="req_2" LAST-CHANGE="2026-10-08T00:00:00Z"><TYPE><SPEC-OBJECT-TYPE-REF>type_req</SPEC-OBJECT-TYPE-REF></TYPE></SPEC-OBJECT></SPEC-OBJECTS></REQ-IF-CONTENT></CORE-CONTENT></REQ-IF>

Expected: schema-valid object with no values is accepted (or a typed unsupported result if the AST intentionally cannot represent absent values). Actual: uncaught AssertionError. Independent offline xmlschema 4.3.1 validation against the exact packaged reqif.xsd succeeds. Original bytes are not normalized for this check.

Activity

  1. stanislaw commented on Nov 15, 2026

    @stanislaw
    Contributor

    Closed by #237.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions