Skip to content

Commit d1a4bd6

Browse files
committed
There is an issue with the spec I am not sure how to solve. The first simpler problem is that customs_item_id is marked as required and not-nullable, but it really should be nullable so it can be left out of the request. However the real issue is with the value property, as it's defined as:
value: allOf: - $ref: '#/components/schemas/monetary_value' description: The total value of the customs item and a monetary value is expected to be a structure that contains the amount and currency type, so it's passed in the request like so: Value = new MonetaryValue { Amount = 42.99, Currency = Currency.Usd, }, but the problem is, in the response, it comes back as a single numeric value: "customs_items": [ { "customs_item_id": "se-11825779", "description": "Product name", "quantity": 2, "value": 42.99, "harmonized_tariff_code": "", "country_of_origin": "US", "unit_of_measure": null } ], So that is completely incorrect as far as the OpenAPI spec is concerned, but it's not clear to me how to fix it? For now the service seems fine with just passing a raw number and it assumes it is in USD, so I am going with that for now.
1 parent f5602bc commit d1a4bd6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

openapi.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7676,6 +7676,7 @@ components:
76767676
properties:
76777677
customs_item_id:
76787678
readOnly: true
7679+
nullable: true
76797680
allOf:
76807681
- $ref: '#/components/schemas/se_id'
76817682
description: A string that uniquely identifies the customs item
@@ -7692,9 +7693,9 @@ components:
76927693
default: 0
76937694
description: The quantity of this item in the shipment.
76947695
value:
7695-
allOf:
7696-
- $ref: '#/components/schemas/monetary_value'
7697-
description: The declared customs value of each item
7696+
type: number
7697+
format: double
7698+
description: The declared customs value of each item in USD
76987699
harmonized_tariff_code:
76997700
type: string
77007701
nullable: true

0 commit comments

Comments
 (0)