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
Hi, I wanted to generate types from the provided yaml using openapi-typescript with this command: openapi-typescript node_modules/shipengine-openapi/openapi.yaml --output src/types/ShipEngineTypes.ts
However, three types seem to have an issue, though not sure on the exact cause
the following modifications do enable the types to work if this is helpful:
update_shipment_response_body:
removed "has_errors" as one of the properties within the WithRequired helper type.
this seems to be a required property of the Create Shipment api and its schema is used
under allof for the Update Shipment api. based on the docs it seems like "has_errors" will
not be returned by the Update Shipment api
pickup_response_body
removed the "pickup" and "notes" properties used within the WithRequired helper type
the pickup property has all the same properties that are already within the schema. I was not
sure but is it possible the "notes" property should be the "pickup_notes" property under required?
get_rate_by_id_response_body
removed the usage of WithoutRequired helper type entirely. It had the
properties: "rates", "invalid_rates", "rate_request_id", "shipment_id", "created_at",
"status" and "errors"
these are all required properties returned from the Get Shipping Rates api which returns
more than one rate and shipment info
Hi, I wanted to generate types from the provided yaml using openapi-typescript with this command:
openapi-typescript node_modules/shipengine-openapi/openapi.yaml --output src/types/ShipEngineTypes.ts
However, three types seem to have an issue, though not sure on the exact cause
type and error for update_shipment_response_body
update_shipment_response_body: WithRequired<components["schemas"]["create_and_validate_shipment"], "errors" | "has_errors" | "address_validation" | "shipment_id" | "carrier_id" | "service_code" | "ship_date" | "created_at" | "shipment_status" | "ship_to" | "ship_from" | "return_to" | "confirmation" | "customs" | "advanced_options" | "insurance_provider" | "tags" | "packages" | "total_weight">;
type and error for get_rate_by_id_response_body
get_rate_by_id_response_body: WithRequired<components["schemas"]["rate"], "rates" | "invalid_rates" | "rate_request_id" | "shipment_id" | "created_at" | "status" | "errors">;
I thought it could be an issue with required fields, for example from the yaml:
in this case I'm not sure if rates should be required for Get Rate By Id which should only be returning one rate based on https://shipengine.github.io/shipengine-openapi/#operation/get_rate_by_id
or in the case of pickup_response_body, pickup is required in addition to all the properties of "pickup" such as pickup_id
The text was updated successfully, but these errors were encountered: