Skip to content

Commit

Permalink
There is an issue with the spec I am not sure how to solve. The first…
Browse files Browse the repository at this point in the history
… 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.

(cherry picked from commit 9a2a8f1)
  • Loading branch information
kendallb committed Mar 27, 2024
1 parent 1bd40d7 commit 87b4a85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8810,6 +8810,7 @@ components:
properties:
customs_item_id:
readOnly: true
nullable: true
allOf:
- $ref: '#/components/schemas/se_id'
description: A string that uniquely identifies the customs item
Expand Down

0 comments on commit 87b4a85

Please sign in to comment.