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

Change type for Calc Fields from BigDecimal to String #34

Conversation

AaronJRubin
Copy link
Contributor

As documented at https://developer.cybozu.io/hc/ja/articles/202166330-%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E5%BD%A2%E5%BC%8F, a Calc field can contain a string representation of a Date, DateTime, or Time in addition to a number. Therefore, we cannot assume that the data will be parsable as a BigDecimal, and the simplest/cleanest fix is just to keep the value as a string and let the consumer of the API handle appropriately.

…here

is no error when the data represents a Date, DateTime, or Time
@AaronJRubin AaronJRubin force-pushed the arubin/accept-non-numeric-values-for-calc-fields branch from b064c1e to c3c456e Compare April 11, 2022 23:34
@tomohiro-okuyama
Copy link
Contributor

@AaronJRubin
Thank you for reporting this!
This PR, unfortunately, seems to contain breaking changes and it's hard to merge these changes promptly.
We'll consider the way to mitigate the issue internally.

@AaronJRubin
Copy link
Contributor Author

@tomohiro-okuyama Have you been able to find a good solution to mitigate this issue that would not introduce a breaking change?

@tomohiro-okuyama
Copy link
Contributor

@AaronJRubin
We decided to deserialize CALC field values to String, but keep the signatures of getters to avoid breaking changes.
Instead, we add some methods to get the raw String values, like String CalcFieldValue.getRawValue()
and String Record.getCalcFieldRawValue().

We are going to merge this PR soon first. After that, we'll add above changes and release it as v1.4.0.
Thank you!

@AaronJRubin
Copy link
Contributor Author

I see - that sounds like a great solution! Thanks so much for moving this forward.

@tomohiro-okuyama tomohiro-okuyama merged commit e74d495 into kintone:master May 12, 2022
@tomohiro-okuyama
Copy link
Contributor

@AaronJRubin
We have merged this PR and added you to the list of contributors (#35).
Thanks again for your contribution.

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

Successfully merging this pull request may close these issues.

None yet

2 participants