The API response from the first request (with shipType=) is:
{"error":{"message":"Request could not be processed due to an invalid payload.","code":422,"data":{"shipType":["The shipType field is required."],"waypointSymbol":["The waypointSymbol field is required."]}}}
The second request (with shib_type=) gives this python error:
Traceback (most recent call last):
File "C:\code\mysp\snippet.py", line 19, in <module>
resp = client.fleet.purchase_ship(ship_type="SHIP_PROBE", waypoint_symbol=shipyard)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\code\mysp\Lib\site-packages\spacetraders\api\fleet\purchase_ship.py", line 80, in sync_detailed
json_body = PurchaseShipJsonBody(**json_body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic\main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for PurchaseShipJsonBody
shipType
field required (type=value_error.missing)
waypointSymbol
field required (type=value_error.missing)
Using the new pydantic style for json_body, I can't seem to pass attributes to purchase_ship().
The API response from the first request (with shipType=) is:
{"error":{"message":"Request could not be processed due to an invalid payload.","code":422,"data":{"shipType":["The shipType field is required."],"waypointSymbol":["The waypointSymbol field is required."]}}}
The second request (with shib_type=) gives this python error: