Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post/Patch/Delete Paths not generated for type casts #529

Open
lorenyaSICKAG opened this issue May 10, 2024 · 0 comments
Open

Post/Patch/Delete Paths not generated for type casts #529

lorenyaSICKAG opened this issue May 10, 2024 · 0 comments

Comments

@lorenyaSICKAG
Copy link

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

image

OData 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 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:

internal class ODataTypeCastPathItemHandler : PathItemHandler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant