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

Generated validation schemas incompatible with proto int64's #146

Open
harveyxia opened this issue Sep 14, 2020 · 0 comments
Open

Generated validation schemas incompatible with proto int64's #146

harveyxia opened this issue Sep 14, 2020 · 0 comments

Comments

@harveyxia
Copy link
Contributor

harveyxia commented Sep 14, 2020

Generated validation schemas (openapi v3 with structural schema contraints) cannot currently be used in conjunction with proto int64's. This is because proto maps the int64 proto type to JSON strings (reference).*

For Solo CRD's, it's unlikely that there will be a use case where int64's must be used instead of an alternative like uint32. However, this constraint may pose an issue for CRDs that import external protobuf schemas (e.g. from Envoy) that do use int64.

Potential solutions for removing the int64 constraint:

  1. Modify our controller serialization behavior so that int64s are not serialized as JSON strings.
  2. Modify the generated openapi schema to replace all int64 types with string or int64. Example:
observedGeneration:
  anyOf:
  - type: string
    type: integer

* This, in turn, is because Javascript represents all numbers as 64-bit floating point values, so Javascript cannot represent numbers larger than 2^53 (more on that here).

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

1 participant