Skip to content

Conversation

@HeikoTheissen
Copy link
Contributor

@HeikoTheissen HeikoTheissen commented Oct 13, 2025

This pull request is not meant to be merged, it only provides a reproducible example for a bug.

In this Swagger UI the path

GET /InsurancePolicy/{InsurPlcyUUID}/{InsurPlcyApplUUID}
/_DistributionPlan/{InsurPlcyUUID-1}/{InsurPlcyApplUUID-1}/{InsurPlcyInsurContr-1}/{InsurPlcyCoveragePackageID-1}/{InsurPlcyCoverageID-1}/{InsurPlcyDistrPlnRelshpID-1}
/_CoinsuranceHeader/{InsurPlcyCoinsurHdrUUID-2}/{InsurPlcyCoinsurVersionID-2}
/_CoinsuranceShareSegment/{InsurPlcyCoinsurHdrUUID-3}/{InsurPlcyCoinsurVersionID-3}/{InsurPlcyCoinsurSegmentID-3}

wrongly repeats the InsurPlcyCoinsurHeader_Type key segments for the navigation property _CoinsuranceShareSegment. According to the OData spec, these key fields must be omitted in the key-as-segment convention, because _CoinsuranceShareSegment has a partner navigation property _CoinsuranceHeader with a referential constraint:

https://github.com/oasis-tcs/odata-openapi/blob/a48b0b23a3bff31000b43e75b2dd6c95258eff33/tools/tests/insurance.xml#L3528-L3537

<NavigationProperty Name="_CoinsuranceHeader"
  Type="com.sap.gateway.srvd_a2x.api_insurancepolicyservice_3.v0001.InsurPlcyCoinsurHeader_Type"
  Nullable="false" Partner="_CoinsuranceShareSegment">
  <ReferentialConstraint
    Property="InsurPlcyCoinsurHdrUUID"
    ReferencedProperty="InsurPlcyCoinsurHdrUUID" />
  <ReferentialConstraint
    Property="InsurPlcyCoinsurVersionID"
    ReferencedProperty="InsurPlcyCoinsurVersionID" />
</NavigationProperty>

@HeikoTheissen HeikoTheissen changed the title OpenAPI path to contained entity wrongly repeats the key segments of the parent OpenAPI path to entity wrongly repeats the parent's key segments despite referential constraint Oct 13, 2025
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

Successfully merging this pull request may close these issues.

1 participant