OpenAPI.NET icon indicating copy to clipboard operation
OpenAPI.NET copied to clipboard

hidi transform fails if input CSDL has Nullable set on a singleton

Open garethj-msft opened this issue 1 year ago • 2 comments

Describe the bug Nullable is a valid property of <Singleton> elements.

To Reproduce Run

hidi transform --csdl foo.csdl

where foo.csdl includes a Nullable attribute on a singleton.

Expected behavior Transformation succeeds with an appropriate mapping to OAS.

Actual behavior

crit: Microsoft.OpenApi.Hidi.Handlers.TransformCommandHandler[0]
      Could not transform the document, reason: Encountered the following errors when parsing the CSDL document:
      UnexpectedXmlAttribute : The attribute 'Nullable' was not expected in the given context. : (1, 956)

Additionally, the reported line number is bogus, as the input file only has 40 lines, with the error coming on line 35.

garethj-msft avatar Jul 26 '23 02:07 garethj-msft

@garethj-msft, do you mind sharing the csdl file for me to reproduce the above scenario?

MaggieKimani1 avatar Jul 26 '23 13:07 MaggieKimani1

@garethj-msft according to the doc reference, a Singleton element expects only 2 attributes, Name and Type

image

irvinesunday avatar Jul 28 '23 14:07 irvinesunday