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

OpenAPI: Timestamps should be int64 #749

Closed
KitsuneRal opened this issue Jan 11, 2021 · 4 comments
Closed

OpenAPI: Timestamps should be int64 #749

KitsuneRal opened this issue Jan 11, 2021 · 4 comments

Comments

@KitsuneRal
Copy link
Member

The following (not conclusively exhaustive) list has timestamps of integer type with no specified format. When format is not specified, Swagger falls back to JSON Schema for type definitions. JSON Schema conveniently says that integers should be distinguished from floating-point numbers, and stops at that.

The conclusion from the above is that we should be clear which integer is used in each particular place. This issue is about timestamps, which should always be int64. The question is - do we need an MSC here or would a clarification be enough.

@turt2live
Copy link
Member

This is another case where the canonical JSON spec disagrees with what we're trying to do with it. https://spec.matrix.org/v1.2/appendices/#signing-json

related: #1085

@KitsuneRal
Copy link
Member Author

int64 stores values corresponding to the range specified in the Canonical JSON text, doesn't it?

@turt2live
Copy link
Member

The spec holds 2^53, not 2^64

@KitsuneRal
Copy link
Member Author

I should learn arithmetics, it seems.

That being said, int64 would still be the best fitting format from Swagger perspective, and server-side validations would guard against numbers out of Canonical JSON range.

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

No branches or pull requests

2 participants