Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formalize REST JSON responses #3406

Closed
qstokkink opened this issue Jan 29, 2018 · 1 comment
Closed

Formalize REST JSON responses #3406

qstokkink opened this issue Jan 29, 2018 · 1 comment

Comments

@qstokkink
Copy link
Contributor

Right now our REST API is very fluid: whatever is returned is returned. We should have a stricter API than this. This is especially bothersome as json crashes with binary data.

This formalization should do two things:

  1. Don't send garbage/binary data through the REST API, which would cause a crash.
  2. Show users the data encoding in the response and automatically ensure this encoding.

We could take the protobuf approach to this, making some kind of meta language for messages, for example:

TORRENTS_GET {
infohash: optional=False, encoding=base64; 
peers: optional=True, encoding=list[hex];
}
@qstokkink
Copy link
Contributor Author

I think this has been addressed a few years ago now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants