You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating an OpenAPI specification of the OData model, it does not generate the post/patch/delete paths for the type cast entities. In my example (see below) CreateJiraIssue is derived from Widget. But it does not generate the paths for post/patch/delete
Create a class A and a derived class B. Add class A as entity set to the odata model.
In the converter settings you need to set RequireDerivedTypesConstraintForODataTypeCastSegments to false.
Expected result
The post/patch/delete paths would be generated for all derived (cast) types.
Actual result
Only the get paths are generated for derived (class) types.
Additional detail
I looked into the code and I have an idea where this is coming from.
The ODataTypeCastPathItemHandler will be used for the path (because of the type cast kind). And there only the Get operation will be set:
When generating an OpenAPI specification of the OData model, it does not generate the post/patch/delete paths for the type cast entities. In my example (see below)
CreateJiraIssue
is derived fromWidget
. But it does not generate the paths for post/patch/deleteOData supports post/patch/delete for the cast types! It works when you do an patch request to the correct url. It is also described here:
https://learn.microsoft.com/en-us/odata/webapi-8/fundamentals/entity-routing?tabs=net60%2Cvisual-studio
Assemblies affected
Microsoft.OpenApi.OData (1.6.3)
Steps to reproduce
Create a class
A
and a derived classB
. Add classA
as entity set to the odata model.In the converter settings you need to set
RequireDerivedTypesConstraintForODataTypeCastSegments
tofalse
.Expected result
The post/patch/delete paths would be generated for all derived (cast) types.
Actual result
Only the get paths are generated for derived (class) types.
Additional detail
I looked into the code and I have an idea where this is coming from.
The
ODataTypeCastPathItemHandler
will be used for the path (because of the type cast kind). And there only the Get operation will be set:OpenAPI.NET.OData/src/Microsoft.OpenApi.OData.Reader/PathItem/ODataTypeCastPathItemHandler.cs
Line 16 in 92c9810
The text was updated successfully, but these errors were encountered: