Skip to content

Commit

Permalink
add openapi.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
dancost committed Jul 23, 2024
1 parent 4ec017b commit d567198
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openapi_trading_platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"openapi":"3.1.0","info":{"title":"Forex Trading Platform API","description":"A RESTful API to simulate a Forex trading platform with WebSocket support for real-time order updates.","version":"1.0.0"},"paths":{"/orders":{"get":{"summary":"Retrieve All Orders","operationId":"retrieve_all_orders_orders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OrderOutput"},"type":"array","title":"Response Retrieve All Orders Orders Get"}}}}}},"post":{"summary":"Post Order","operationId":"post_order_orders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderInput"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderOutput"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orders/{orderId}":{"get":{"summary":"Get Order By Id","operationId":"get_order_by_id_orders__orderId__get","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"string","title":"Orderid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderOutput"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Cancel An Order","operationId":"cancel_an_order_orders__orderId__delete","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"string","title":"Orderid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"OrderInput":{"properties":{"stocks":{"type":"string","title":"Stocks","description":"Currency pair symbol (e.g. 'EURUSD'), or any other stuff"},"quantity":{"type":"number","title":"Quantity","description":"Quantity of the currency pair to be traded"}},"type":"object","title":"OrderInput"},"OrderOutput":{"properties":{"stocks":{"type":"string","title":"Stocks","description":"Currency pair symbol (e.g. 'EURUSD'), or any other stuff"},"quantity":{"type":"number","title":"Quantity","description":"Quantity of the currency pair to be traded"},"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["PENDING","EXECUTED","CANCELED"],"title":"Status","description":"Status of the order"}},"type":"object","required":["id"],"title":"OrderOutput"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}

0 comments on commit d567198

Please sign in to comment.