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
Add vesselIMONumber query filter to voyage-references API spec
✨ Enhancement📝 Documentation🕐 Less than 10 minutes
AI Description
• Document a new vesselIMONumber query parameter for GET /voyage-references.
• Constrain the parameter with a 7–8 digit numeric pattern and length limits.
• Clarify behavior: only return partner voyages matching the provided IMO number.
The following are alternative approaches to this PR:
1. Promote vesselIMONumber to a reusable OpenAPI parameter component
➕ Avoids duplication if other endpoints add the same filter later
➕ Ensures consistent validation/description across the spec
➖ Slightly more indirection in the YAML for a single use-case
➖ Requires refactoring if the spec currently keeps parameters inline
2. Model IMO as an integer query parameter
➕ More explicit “numeric” intent for consumers
➕ May simplify some client-side validation
➖ Loses leading-zero safety (if ever applicable) and can be awkward in some clients
➖ OpenAPI tooling often treats query integers differently than string patterns; current pattern validation is clearer
Recommendation: Current inline string+pattern approach is appropriate for a single endpoint and provides precise validation. If the API roadmap suggests reusing IMO filtering elsewhere, extracting vesselIMONumber into components/parameters would improve consistency and maintainability.
Files changed (1) +10 / -0
Documentation (1) +10 / -0
OVS_HUB_REF_v1.0.0.yamlAdd vesselIMONumber query parameter to /voyage-references+10/-0
Add vesselIMONumber query parameter to /voyage-references
• Introduces a new 'vesselIMONumber' query parameter for 'GET /voyage-references'. The parameter is documented with a numeric regex pattern and 7–8 character length constraints, and the description clarifies that results are restricted to voyages matching the provided IMO number.
vesselIMONumber was added as a query parameter, but the endpoint’s documented mandatory filter
conditions were not updated, leaving it ambiguous whether vesselIMONumber can be used alone or
only as an additional narrowing filter. This ambiguity can cause client implementations to
misconstruct requests or avoid using the new filter due to unclear contract semantics.
+ - name: vesselIMONumber+ in: query+ description: |+ The identifier of a vessel via the `vesselIMONumber`. The result will only return partner voyages including the `vesselIMONumber`.+ schema:
Evidence
The operation description explicitly states mandatory filters and lists only four voyage filters,
but the newly added vesselIMONumber parameter is not mentioned in those requirements, creating
ambiguity about whether it is mandatory/alternative/additional.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`GET /v1/voyage-references` documents mandatory filters (service + one of the existing voyage filters), but the newly added `vesselIMONumber` parameter is not reflected in those conditions. The contract should explicitly state whether `vesselIMONumber` (a) can satisfy the “voyage filter” requirement, or (b) is only an optional additional filter that still requires the existing mandatory filters.
## Issue Context
The endpoint-level description and per-parameter **Condition** notes currently enumerate only `carrierImportVoyageNumber`, `carrierExportVoyageNumber`, `universalImportVoyageReference`, and `universalExportVoyageReference` as mandatory voyage filters, while the new `vesselIMONumber` parameter is added without integrating it into that narrative.
## Fix Focus Areas
- ovs_hub_ref/v1/OVS_HUB_REF_v1.0.0.yaml[201-213]
- ovs_hub_ref/v1/OVS_HUB_REF_v1.0.0.yaml[241-311]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. IMO length inconsistent 🐞 Bug≡ Correctness
Description
The new vesselIMONumber query parameter allows 7 or 8 digits (^\d{7,8}$), which conflicts with
other specifications in this repo that define IMO number as exactly 7 digits. This inconsistency can
lead to interoperability issues and inconsistent client/server-side validation across APIs.
The added parameter explicitly permits 8 digits, while other repo specs define vesselIMONumber as
exactly 7 digits, demonstrating a concrete contract inconsistency introduced/expanded by this
change.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The new `vesselIMONumber` query parameter schema accepts 8-digit values, but other authoritative-looking specs in this repo define `vesselIMONumber` as exactly 7 digits. Update the query parameter schema (and, if appropriate, the shared Vessel schema) to match the intended standard.
## Issue Context
`OVS_v3.0.2` and `dcsa_domain_v3.1.1` define `vesselIMONumber` as `^\d{7}$` with `maxLength: 7`. The hub reference spec’s new query parameter currently uses `^\d{7,8}$` with `maxLength: 8`.
## Fix Focus Areas
- ovs_hub_ref/v1/OVS_HUB_REF_v1.0.0.yaml[302-311]
- ovs_hub_ref/v1/OVS_HUB_REF_v1.0.0.yaml[812-819]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.