Adjust SDKs for new WebSocket openapi definitions#55
Conversation
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
| $ref: './websocket-api.yaml#/components/schemas/RecentTradesUpdates' | ||
| RecentTradesUpdate: | ||
| $ref: './websocket-api.yaml#/components/schemas/RecentTradesUpdate' | ||
| OrderbookDiffDepthUpdate: |
There was a problem hiding this comment.
I'm confused, what happened to all of these?
There was a problem hiding this comment.
Context: we use bluefin-api as our "main" file, which contains all the endpoint routes. Openapi generator will generate message types according to the requests and responses used by the endpoint paths in the bluefin-api.yaml file.
BUT for web sockets, it's a special case, since the endpoint routes return multiple types for the same route, so I initially added all the response types into this file, so that openapi generator picks them up.
HOWEVER, while working on it last night, I realized that I only need to add the top most level message types, and since we define all our response types in the top level messages through enums, openapi generator will pick all the needed types up. So we only really need to include the top level messages, which we only have 4-5: subscriptions, subscription response and data stream message main enum
There was a problem hiding this comment.
Heck yes! Getting out of the way and letting the tool do work for us! 🎉
| description: "The filled quantity of the order in scientific notation with 9 decimal places." | ||
| side: | ||
| $ref: '#/components/schemas/Side' | ||
| $ref: './common.yaml#/components/schemas/TradeSide' |
There was a problem hiding this comment.
Guess we'll merge TradeSide and PositionSide some other time
| type: object | ||
| description: "Details about a trade in the account." | ||
| properties: | ||
| tradeId: |
There was a problem hiding this comment.
Nice to merge them all into one
PR Type
Enhancement, Bug fix, Documentation, Tests
Description
Introduced
AccountAggregatedTradeUpdatemodel for aggregated trade details.AccountAggregatedTradeUpdatein TypeScript, Rust, and Python SDKs.AccountAggregatedTradeUpdate.Replaced
SidewithPositionSideandTradeSidefor better clarity.Removed redundant models like
RecentTradesUpdateandSide.Trademodel.Updated documentation to reflect schema and model changes.
AccountAggregatedTradeUpdate.Added unit tests for
AccountAggregatedTradeUpdatein Python SDK.Changes walkthrough 📝
13 files
AddedAccountAggregatedTradeUpdateand updated trade-related models.Added `AccountAggregatedTradeUpdate` model in Rust.Added `AccountAggregatedTradeUpdate` to `AccountDataStream` enum.Added `AccountAggregatedTradeUpdate` to `AccountEventType` enum.Added `AccountAggregatedTradeUpdate` to `AccountStreamMessage`.AddedAccountAggregatedTradeUpdatetoAccountStreamMessagePayload.Refactored `AccountTradeUpdate` to use `Trade` model.Replaced `RecentTradesUpdate` with `Trade` in `RecentTradesUpdates`.Simplified `Trade` model by removing redundant enums.Added `AccountAggregatedTradeUpdate` model in Python SDK.Refactored `AccountTradeUpdate` to use `Trade` model in Python SDK.Added WebSocket handling for `AccountAggregatedTradeUpdate`.Simplified `Trade` schema by removing redundant enums.2 files
Replaced `Side` with `PositionSide` in `AccountPositionUpdate`.Replaced `Side` with `TradeSide` in `ActiveOrderUpdate`.2 files
Registered `AccountAggregatedTradeUpdate` model in Rust module.Added `AccountAggregatedTradeUpdate` to Python SDK imports.1 files
Added unit tests for `AccountAggregatedTradeUpdate`.2 files
Updated OpenAPI spec to include `AccountAggregatedTradeUpdate`.Updated WebSocket API spec for `AccountAggregatedTradeUpdate`.30 files