You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enforcing a policy returning a JSON object for all API endpoints would allow for better flexibility in making changes to endpoints in the future.
For example, the response of /api/addresses/<address>/outputs/siacoin is currently JSON serialization of []types.SiacoinElement or [<utxo0>, <utxo1>, <utxo2>]. If we needed to add a field to this endpoint in the future, it would require a breaking change for all apps or clients utilizing this endpoint.
If we use a dedicated type instead:
type utxo_response struct {
outputs []types.SiacoinElement
}
or
{"outputs": [<utxo0>, <utxo1>, <utxo2>]}
Adding additional fields will not introduce a breaking change for clients. Older clients will be served the same data while ignoring the newly added fields.
Version
No response
What operating system are you running (e.g. Ubuntu 22.04, macOS, Windows 11)?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Thank you for your message! We are considering adding a policy like that in the future when we formalize our engineering guidelines and for new endpoints. However, we don't want to break our existing API for the sake of hopefully not breaking it in the future right now.
Description
Enforcing a policy returning a JSON object for all API endpoints would allow for better flexibility in making changes to endpoints in the future.
For example, the response of
/api/addresses/<address>/outputs/siacoin
is currently JSON serialization of[]types.SiacoinElement
or[<utxo0>, <utxo1>, <utxo2>]
. If we needed to add a field to this endpoint in the future, it would require a breaking change for all apps or clients utilizing this endpoint.If we use a dedicated type instead:
or
Adding additional fields will not introduce a breaking change for clients. Older clients will be served the same data while ignoring the newly added fields.
Version
No response
What operating system are you running (e.g. Ubuntu 22.04, macOS, Windows 11)?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: