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

Operate.getJSONVariablesforProcess needs to be made lossless #80

Closed
jwulf opened this issue Mar 21, 2024 · 1 comment
Closed

Operate.getJSONVariablesforProcess needs to be made lossless #80

jwulf opened this issue Mar 21, 2024 · 1 comment
Assignees
Milestone

Comments

@jwulf
Copy link
Member

jwulf commented Mar 21, 2024

The lossless Json parser from #78 needs to be used for the convenience method getJSONVariablesforProcess.

User variables may contain int64 values.

We should allow the user to optionally pass in a class that extends LosslessDto to be able to get the variable data back with no loss of precision.

As a fall-back (when no user Dto is passed in), we could parse it using lossless-json, and then convert any unsafe numbers into BigInt or string.

Making it a string would make it consistent with how we handle int64 in the SDK - however, without metadata about the payload typing, we are reduced to examining the actual payload and we can only detect int64 when the value exceeds the range of the JS number type.

This means that the type of the field would vary depending on the value - which is strange behaviour. This could lead to application errors where string concatenation could occur when arithmetic addition was expected.

@jwulf jwulf self-assigned this Mar 21, 2024
@jwulf jwulf added this to the 8.5.0 milestone Mar 21, 2024
@jwulf
Copy link
Member Author

jwulf commented Mar 22, 2024

According to the OpenAPI schema, the type of the value for a variable retrieved in this way is always string.

So it requires no coercing or serialising to a different type.

@jwulf jwulf closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant