Skip to content

Make RateResponseRatedShipment::getTimeInTransit nullable#41

Merged
elidrissidev merged 1 commit intoShipStream:mainfrom
zambodaniel:make_rate_response_rated_shipment_time_in_transit_nullable
Feb 5, 2026
Merged

Make RateResponseRatedShipment::getTimeInTransit nullable#41
elidrissidev merged 1 commit intoShipStream:mainfrom
zambodaniel:make_rate_response_rated_shipment_time_in_transit_nullable

Conversation

@zambodaniel
Copy link
Copy Markdown
Contributor

This pull request updates the handling of the TimeInTransit property in the rating API response to allow for nullable values, improving compatibility with cases where this information may not be present. The changes affect the OpenAPI schema, the model, and the normalization/denormalization logic.

OpenAPI schema update:

  • Allow RatedShipment_TimeInTransit to be nullable in the OpenAPI definition, making it explicit that this field can be missing or null in responses.

Model changes:

  • Update the RateResponseRatedShipment model so that the timeInTransit property, its getter, and setter all accept null values, reflecting the schema change and preventing type errors when the property is absent. [1] [2]

Serialization/deserialization logic:

  • Adjust the RateResponseRatedShipmentNormalizer to correctly handle TimeInTransit being null during both denormalization (object creation from data) and normalization (object serialization). This ensures that null values are set and output properly, maintaining consistency with the model and schema. [1] [2]

Copilot AI review requested due to automatic review settings February 5, 2026 14:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request makes the TimeInTransit property nullable in the RateResponseRatedShipment model to handle cases where this information may not be present in API responses. The implementation follows established patterns in the codebase for handling nullable properties.

Changes:

  • Added nullable: true to the RatedShipment_TimeInTransit schema definition in OpenAPI specification files
  • Updated the model class to allow null values for the timeInTransit property, getter, and setter
  • Enhanced serialization/deserialization logic to properly handle null values during normalization and denormalization

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
openapi/Rating.yaml Added nullable: true attribute to RatedShipment_TimeInTransit schema definition
openapi.yaml Added nullable: true attribute to RatedShipment_TimeInTransit schema definition; also includes unrelated formatting changes
src/Api/Model/RateResponseRatedShipment.php Updated property type annotations and method signatures to accept null values
src/Api/Normalizer/RateResponseRatedShipmentNormalizer.php Added null handling in denormalization and updated normalization to work with nullable values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openapi.yaml
post:
summary: 'Acceptance Audit Pre-check'
description: 'Enables shippers perform pre-checks before shipping dangerous goods using the chemical record identifier and the commodity''s regulated level code.'
description: "Enables shippers perform pre-checks before shipping dangerous goods using the chemical record identifier and the commodity's regulated level code."
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The openapi.yaml file contains many changes that are not related to the TimeInTransit nullable update described in the PR. These include:

  1. Quote style changes throughout the file (converting escaped single quotes to double quotes, e.g., line 285, 846, and many others)
  2. Reordering of HTTP methods for the '/freight/{version}/pickups' endpoint (DELETE method moved before POST method, lines 8160-8206)

While these changes don't introduce functional issues, they make the PR harder to review and increase the risk of unintended changes. Consider separating formatting/style changes from functional changes in future PRs for better clarity and maintainability.

Copilot uses AI. Check for mistakes.
@elidrissidev elidrissidev changed the title Make \ShipStream\Ups\Api\Model\RateResponseRatedShipment::getTimeInTr… Make RateResponseRatedShipment::getTimeInTransit nullable Feb 5, 2026
@elidrissidev
Copy link
Copy Markdown
Collaborator

Thanks @zambodaniel!

@elidrissidev elidrissidev merged commit 118c14d into ShipStream:main Feb 5, 2026
6 of 7 checks passed
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.

3 participants