SpaceTradersAPI / api-docs

The API documentation for the SpaceTraders API
143 stars 35 forks source link

Market Transaction minimums incorrect in OpenAPI Spec #46

Closed cscattaglia917 closed 1 year ago

cscattaglia917 commented 1 year ago

Issue: Marketplaces can have transactions where values do not conform to the required minimums stated in OpenAPI spec. An example provided in the Discord by a fellow user:


{'waypointSymbol': 'X1-VS75-67965Z',
    'shipSymbol': 'SP4CE-ADMIR4L-3',
    'tradeSymbol': 'FUEL',
    'type': <Type1.PURCHASE: 'PURCHASE'>,
    'units': 0,
    'pricePerUnit': 252,
    'totalPrice': 0,
    'timestamp': datetime.datetime(2023, 5, 21, 10, 31, 18, 972000, tzinfo=datetime.timezone.utc)}

Proposed fix: Units & TotalPrice minimum values in models/MarketTransaction.json should be updated to 0?

Interestingly enough, minimums for similar properties in models/MarketTradeGood.json are set to 0:


    "purchasePrice": {
      "type": "integer",
      "description": "The price at which this good can be purchased from the market.",
      "minimum": 0
    },
    "sellPrice": {
      "type": "integer",
      "description": "The price at which this good can be sold to the market.",
      "minimum": 0
    }
space-admiral commented 1 year ago

Great catch! Thanks for reporting this. Just pushed the fix.