Tha Bitso API does not follow the reuse release equivalence principle which impose that:
Reuse Release Equivalence Principle. ... The granule of reuse is the granule of release. Only components that are released through a tracking system can effectively be reused. This granule is the package.
This means that as a Bitso API user I'm not protected from changes in the API.
The best way to overcome this for now it's to install the bitso client and use a proxy to sniff the requests made to the API.
Right now we support Public API calls.
Tasks
You can find our sprint board on: https://github.com/JuIioCesar/Bitso/projects/1
API Response Models
To build the models I usually use: http://www.json4swift.com with the latest Swift 4 Codeable Mapping along with this process:
- Go to https://bitso.com/api_info
- Choose a private endpoint. You can raise an issue and assign it to yourself to communicate that you are working on an specific endpoint
- Copy the JSON Response
- Use JSON Response as input of http://www.json4swift.com
- Download the generated files
- Remove optionals from the generated files using the next two points
- You can use Find and Replace to remove the
?
from those files before adding them to the project. - You can use Find and Replace to replace the
decodeIfPresent
for adecode
in the generated files before adding them to the project. - Correct automated code in subcontainers by replacing code like
payload = Payload(decoder)
fordecode(Payload.self, key: "payload")
- Add the generated files to the project.
- Test the models using a unit test.
- Rename structs to verbose names like
Book
instead ofPayload
andBooksResponse
instead ofJson4Swift_Base
- Add your name to the contributors list
- Raise a Pull Request
Contributors
Julio César Guzmán Villanueva