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

Cast transformer should handle cast failures somehow #219

Open
KristianLyng opened this issue Mar 22, 2022 · 0 comments
Open

Cast transformer should handle cast failures somehow #219

KristianLyng opened this issue Mar 22, 2022 · 0 comments
Labels
enhancement New feature or request Transformer

Comments

@KristianLyng
Copy link
Collaborator

Today, the Cast transfromer will simply fail if Sscanf can't convert a field to the desired value. For many use cases, that's reasonable, but for some schemas, it would be better to set a known value. E.g., if a provider sends "supposedNumber": "null", it might be more desireable to convert that to 0.0 or -1 or something the operator selects than simply failing entirely.

You can still work around this today by converting everything to string in a cast transformer, using the edit transformer to change things like "null" to whatever you want, then cast it back, but it's non-obvious, cumbersome and will make skogul convert everything even when it's not necessary.

@KristianLyng KristianLyng added enhancement New feature or request Transformer labels Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Transformer
Projects
None yet
Development

No branches or pull requests

1 participant