Skip to content

Rate Oracle - error validation list does not match the source list #121

@rapcmia

Description

@rapcmia

Describe the bug

When adding invalid source, the expected list does not match with the source list

Rate oracle source list

curl -s -u ralphwashere:XXX 'http://139-xx-xx:8000/rate-oracle/sources' | jq
[
  "binance",
  "coin_gecko",
  "coin_cap",
  "kucoin",
  "ascend_ex",
  "gate_io",
  "coinbase_advanced_trade",
  "cube",
  "dexalot",
  "hyperliquid",
  "hyperliquid_perpetual",
  "derive",
  "mexc"
]
logs: 13:04:54.460 GET /rate-oracle/sources INFO:     139-xx-xx:39380 - "GET /rate-oracle/sources HTTP/1.1" 200 OK

Rate oracle response when you add invalid source, observed the expected does not match the list above

curl -s -u ralphwashere:XXX -X PUT 'http://139-xx-xx:8000/rate-oracle/config' -H 'Content-Type: application/json' -d '{"rate_oracle_source": {"name": "xxxx"}}' | jq
{
  "detail": [
    {
      "type": "enum",
      "loc": [
        "body",
        "rate_oracle_source",
        "name"
      ],
      "msg": "Input should be 'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'",
      "input": "mexc",
      "ctx": {
        "expected": "'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'"
      }
    }
  ]
}
logs: 13:04:58.875 PUT /rate-oracle/config INFO:     139-xx-xx:56550 - "PUT /rate-oracle/config HTTP/1.1" 422 Unprocessable Entity

Steps to reproduce bug

  1. Run PUT /rate-oracle/config with invalid source

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions