OVS 3.0: SD-3052: Add 'responseScope' to limit response#631
Conversation
Review Summary by QodoAdd responseScope parameter to limit voyage response scope
WalkthroughsDescription• Add responseScope query parameter to limit response scope • Support FULL_VOYAGE (default) and MATCHED_CALLS response modes • Allow partial voyage returns when filtering by specific ports • Update API documentation with new parameter behavior and examples Diagramflowchart LR
A["GET /v3/service-schedules"] -->|"responseScope parameter"| B["Response Scope Options"]
B -->|"FULL_VOYAGE default"| C["Return entire matched voyages"]
B -->|"MATCHED_CALLS"| D["Return only matched transportCalls"]
C -->|"Filter: UNLocationCode=DEHAM"| E["All ports in matching voyages"]
D -->|"Filter: UNLocationCode=DEHAM"| F["Only DEHAM transportCalls"]
File Changes1. ovs/v3/OVS_v3.0.2.yaml
|
Code Review by Qodo
1. Conflicting voyage scope docs
|
| The number of service schedules in the list can be narrowed down by providing filter parameters. The resulting payload will always include **entire voyage(s) being matched**, unless otherwise specified (see `responseScope` query parameter). This means that even though a filter only matches a single `Port` in a `Voyage` or a single `Timestamp` within a `Port` in a `Voyage` - **the entire Voyage matched** is returned. If the `carrierImportVoyageNumber` of the `Port` differs from the `carrierExportVoyageNumber` of the `Port` then the **entire Voyage** for both these Voyage numbers are included. | ||
|
|
||
| An example of this is when `&UNLocationCode=DEHAM` is used as a filter parameter. In this case **entire Voyages** would be listed where `DEHAM` is a `Port`. | ||
|
|
||
| **Note as of v3.0.2:** If `responseScope` is used with the `MATCHED_CALLS` value then only **partial voyage(s) will potentially be returned**. This means that if a filter only matches a single `Port` (`UNLocationCode`) in a `Voyage` or a single `Timestamp` within a `Port` in a `Voyage` - **only matched transportCalls** are returned. If the `carrierImportVoyageNumber` of the `Port` differs from the `carrierExportVoyageNumber` of the `Port` then the **matched transportCalls** where either one (or both) match the filter are included. | ||
|
|
||
| An example of this is when `&UNLocationCode=DEHAM` is used as a filter parameter. In this case **transportCalls matching `DEHAM`** would be included. |
There was a problem hiding this comment.
1. Conflicting voyage scope docs 🐞 Bug ≡ Correctness
responseScope=MATCHED_CALLS is documented to return only matched transportCalls, but existing filter parameter descriptions (e.g., UNLocationCode, facilitySMDGCode, startDate, endDate) still state they return **entire Voyages**, making the OpenAPI contract contradictory. This will mislead client implementations and testers about what the endpoint returns when responseScope is used.
Agent Prompt
## Issue description
The new `responseScope` feature allows partial voyages (`MATCHED_CALLS`), but several existing query parameter descriptions still claim that using those filters will return *entire* voyages. This creates an internal contradiction in the OpenAPI spec.
## Issue Context
The endpoint description now mentions `responseScope` can change behavior, but parameter-level docs still describe the legacy/full-voyage behavior unconditionally.
## Fix Focus Areas
- ovs/v3/OVS_v3.0.2.yaml[133-171]
### Suggested change
Update the descriptions for `UNLocationCode`, `facilitySMDGCode`, `startDate`, and `endDate` (and any similar text) to either:
- remove unconditional "entire voyage" wording, or
- explicitly qualify it with “when `responseScope=FULL_VOYAGE` (default)”, and describe the `MATCHED_CALLS` behavior consistently.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Pull request overview
Adds a responseScope query parameter to OVS service schedules so consumers can request either full matched voyages or only matched transport calls.
Changes:
- Updates endpoint description to explain default full-voyage behavior and the new partial-voyage behavior.
- Adds the
responseScopequery parameter with documented valuesFULL_VOYAGEandMATCHED_CALLS.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
i like that qodo folk helping with the review. |
SD-3052: Add
responseScopefilter allow results to only include partial voyages