Skip to content

[Bug]: QueryFormattedValue returns OtherContent instead of the names of the selected enumeration literals  #88

Open

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

ReqIFSharp.Extensions: AttributeValueExtensions.QueryFormattedValue() formats an AttributeValueEnumeration as the Properties.OtherContent of the selected EnumValues, joined by ;. OtherContent is free text that most tools leave empty or fill with an internal value; the name users know is the literal's LongName.

In the ReqIF Viewer this shows up as values like "Other content for: not applicable" (Subset026 sample) and as empty cells for other files.

Proposal

  • Return the LongName of the selected literals (falling back to Identifier), or keep the current behaviour and add a method that returns the names. Changing it is a breaking change for anyone who relies on OtherContent; mark it as such in the CHANGELOG if chosen.

Acceptance criteria

  • For Datatype-Demo.reqif (test data), the enumeration values are formatted as the literal names, for example "One;Two;Three".

Steps to Reproduce

var reqif = new ReqIFDeserializer().Deserialize("Datatype-Demo.reqif").First();
var value = reqif.CoreContent.SpecObjects.SelectMany(o => o.Values).OfType<AttributeValueEnumeration>().First();
Console.WriteLine(string.Join(", ", value.Values.Select(v => v.LongName))); // One, Two, Three
Console.WriteLine(value.QueryFormattedValue());                             // 1;2;3 (the OtherContent of each literal)

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