citycoins / api

A simple API to interact with Stacks and CityCoins data.
https://api.citycoins.co/docs
Apache License 2.0
9 stars 2 forks source link

Bug: response types inconsistent #45

Closed whoabuddy closed 2 years ago

whoabuddy commented 2 years ago

This is one I'm surprised we didn't catch earlier.

All SingleValue entries are passed to the response as either string | boolean. These can be numbers, too, and the docs are not consistent with the endpoints.

Shows it returns a number: https://api.citycoins.co/docs#tag/Mining/paths/~1mining~1get-block-winner-id~1{cityname}~1{blockheight}/get

Actually returns a string: {"value":"407"} https://api.citycoins.co/mining/get-block-winner-id/mia/49000

I think it's something with how we're using micro-stacks as the Stacks block height endpoint returns a number: https://api.citycoins.co/stacks/get-block-height

This will be interesting to look at alongside #40

whoabuddy commented 2 years ago

Closing this out as SingleValue now accepts string | number | boolean