3commas-io / 3commas-official-api-docs

Official Documentation for the 3commas APIs
https://3commas.io
251 stars 87 forks source link

OpenApi Response and Entity Definitions #154

Open ozum opened 1 year ago

ozum commented 1 year ago

Hi,

When I try to fetch data with a typed client, I got lots of validation errors.

Most of the fields has null values. However, according to the OpenApi doc, they should not be null:

Below is an example I got from { "ver1/bots", { limit: 1 } } (There are much more, but my console history cannot have it all to copy):

Details ```json [ { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 40, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 40, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 40, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 40, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 40, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 40, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 40, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 40, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 41, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 41, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 41, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 41, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 41, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 41, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 41, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 41, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 41, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 41, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 42, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 42, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 42, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 42, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 42, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 42, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 42, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 42, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 42, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 42, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 43, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 43, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 43, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 43, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 43, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 43, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 43, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 43, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 43, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 43, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 44, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 44, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 44, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 44, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 44, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 44, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 44, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 44, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 44, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 44, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 45, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 45, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 45, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 45, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 45, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 45, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 45, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 45, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 45, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 45, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 46, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 46, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 46, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 46, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 46, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 46, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 46, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 46, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 46, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 46, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 47, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 47, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 47, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 47, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 47, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 47, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 47, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 47, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 47, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 47, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 48, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 48, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 48, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 48, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 48, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 48, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 48, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 48, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 48, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 48, "max_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "array", "path": [ 49, "strategy_list" ], "message": "Expected string, received array" }, { "code": "invalid_type", "expected": "boolean", "received": "null", "path": [ 49, "trailing_enabled" ], "message": "Expected boolean, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 49, "deal_start_delay_seconds" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 49, "disable_after_deals_count" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 49, "deals_counter" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 49, "allowed_deals_on_same_pair" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "number", "received": "null", "path": [ 49, "close_deals_timeout" ], "message": "Expected number, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 49, "min_volume_btc_24h" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 49, "min_price" ], "message": "Expected string, received null" }, { "code": "invalid_type", "expected": "string", "received": "null", "path": [ 49, "max_price" ], "message": "Expected string, received null" } ] ```
ozum commented 1 year ago

When I looked into https://github.com/3commas-io/3commas-official-api-docs/blob/master/3commas_openapidoc.yml, I see two general problems related to this issue:

Entities (i.e. BotEntity)

  1. Nullable fields do not have null types in the definition.
  2. Required fields are not set as required.

Could you please update/fix the OpenApi file? It is very helpful for development.