amir-the-h / okex

Golang API wrapper of OkEX
Apache License 2.0
100 stars 102 forks source link

[BUG] Wrong json field value in public market API #16

Closed marperia closed 2 years ago

marperia commented 2 years ago

Describe the bug I can't fetch tickers because of wrong JSON field declaration

To Reproduce Steps to reproduce the behavior:

  1. I took your readme example
  2. I wrote some go code
    
    client.Rest.Market = rest.NewMarket(client.Rest)

getSwapTickers := market.GetTickers{ InstType: okex.SwapInstrument, } swapTickers, err := client.Rest.Market.GetTickers(getSwapTickers) if err != nil { log.Fatalln(err) }


3. I saw the error
`json: invalid use of ,string struct tag, trying to unmarshal "SWAP" into okex.InstrumentType`

**Additional information**
Actually I have fixed it already, so it's just representative issue to make a PR
github-actions[bot] commented 2 years ago

Message that will be displayed on users first issue

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

amir-the-h commented 2 years ago

@marperia Thanks for reporting this and sorry for the late response. I've been busy with my career recently. I left a review on your PR. If you can apply it we can merge your fix into the repo.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.