decentraland / content-service

🎨 IPFS Alternative HTTP Interface
https://content.decentraland.org
Apache License 2.0
4 stars 5 forks source link

Incompatible endpoints #149

Open menduz opened 5 years ago

menduz commented 5 years ago

I've seen the new endpoints are not compatible with unity /parcel_info and /scenes. New endpoints are also inconsistent with the old ones, those returned lists instead of dictionaries.


/scenes returns a data type

type Response = Dictionary<string, string>

Which is impossible to optimize in unity (it requires external libraries). A recommended response type may look like

type SceneEntry = {
  cid: string
  id: string
}
type Response = {
  data: Array<SceneEntry>
}

It uses "data: Array" because returning arrays in top level is also hard to parse and it keeps the schema open to extensions in the future


/parcel_info also returns a dictionary

menduz commented 5 years ago

This happened to us before, I wrote a little bit about it here https://menduz.com/posts/lessons-learned-designing-APIs/