fix: use OData V4 path for OpenAPI server URL if no protocol is set to match @sap/cds default behavior - #175
Conversation
…o match @sap/cds default behavior Signed-off-by: Lukas Schwabe <lukas.schwabe@amag.ch>
|
Hi @cronossclk , thank you for reporting this behaviour and for providing a fix! I thus propose the following addition to your PR:
Users can then restore the old behaviour by providing Best, |
| const protocols = []; | ||
|
|
||
| if(odataVersion === "4.01"){ | ||
| protocols.push("rest"); |
There was a problem hiding this comment.
Just flagging: this still enables rest when odata-version is explicitly 4.01, which contradicts the new odata default below.
Before: When OpenAPI generates a document for an OData V4 service, it may advertise the REST base path:
After: The generated
servers.urlmatches the service’s OData V4 runtime endpoint:This affects only the URL advertised in the OpenAPI document. It does not change:
@path--openapi:urlvaluesThis PR fixes #174
Test results: