Closed mikepizzo closed 1 year ago
Strange, we even have a test case for Jetsons that checks the entity container:
The test passes, and running the tool from the command line also produces correct CSDL JSON.
Weird.
It looks like api-designer pulls rsdl-js from nuget, not from our project. Perhaps it was a bug in the nuget package that doesn't exist in the latest source.
I'll check to see if referencing the latest source fixes the issue in the designer.
Updated packages to point to rsdl-js project, but still getting $ContainsTarget in the entity sets/singletons in CSDL tab of api-designer. This is definitely coming from directly from the parse() method (not inserted from elsewhere); curiously, the urlEditor also individually calls parse() to parse the same rsdl just prior to parsing for the csdl tab, and the urlEditor gets the correct result (no $ContainsTarget for the entityset/singleton).
The problem is in odata-openapi
: it modifies its JSON input and injects $ContainsTarget
into container children because from an OpenAPI perspective they behave like containment navigation properties.
Steps to Repro:
Result: competitors entity set and company singleton both contain the "$ContainsTarget=true" properties:
Expected: $ContainsTarget should only be valid on a navigation property.
More Information: $ContainsTarget is set on line 407 of parser.js. According to line 399 this line should only be encountered if $Kind is EntityType or ComplexType, but it seems the line is being hit for entity sets and singletons, which have no $Kind.