Skip to content

[Bug]: IS-EDITABLE="false" is lost when a document is read and written again  #86

Closed

Description

@samatstariongroup

What type of issue is this?

  • Bug report
  • Feature request

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the reqifsharp
  • I have searched open and closed issues to ensure it has not already been reported

Description

AccessControlledElement.WriteXml and WriteXmlAsync write the IS-EDITABLE attribute only when IsEditable is true. An explicit IS-EDITABLE="false" in the source document is therefore dropped when the document is read and written again, and the receiving tool falls back to its own default.

This matters for round-trips (see also #44, which retains the namespaces of the root element) and for the planned editing feature of the ReqIF Viewer, which should respect and preserve the editability set by the source tool.

The same change was made in a fork in 2021 (FernCreek/reqifsharp, "Update AccessControlledElement.cs", adding an IsEditableSpecified flag), but never proposed upstream.

Proposal

  • Record whether IS-EDITABLE was present on read (for example a nullable bool? or an IsEditableSpecified flag) and write it whenever it was present or set explicitly, in both sync and async writers.

Acceptance criteria

  • A document with IS-EDITABLE="false" on a spec object, read and written again, still has IS-EDITABLE="false"; elements without the attribute still have none.

Steps to Reproduce

  1. Take a ReqIF file with <SPEC-OBJECT IDENTIFIER="so-1" IS-EDITABLE="false" ...>.
  2. var reqifs = new ReqIFDeserializer().Deserialize("in.reqif");
  3. new ReqIFSerializer().Serialize(reqifs, "out.reqif");
  4. out.reqif contains <SPEC-OBJECT IDENTIFIER="so-1" ...> without IS-EDITABLE.

System Configuration

  • reqifsharp version: ReqIFSharp 10.1.2, ReqIFSharp.Extensions 5.2.2
  • Environment (Operating system, version and so on): Windows 11
  • .NET Framework version: .NET 10
  • Additional information: Found while planning editing and export in the ReqIF Viewer.
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions