3 ms·
Here's a quick gist that does what I think you want, modulo any specific error handling. https://gist.github.com/usernamefornow/14f972df9429146b46846595b80e5fe2
by name_for_now 10y ago
Here's a quick gist that does what I think you want, modulo any specific error handling. https://gist.github.com/usernamefornow/14f972df9429146b46846595b80e5fe2 https://gist.github.com/usernamefornow/14f972df9429146b46846...
edit: note that the cleanest way would probably to write your own converter so you could avoid the union type, but I didn't want to put that in and have to write a comment about it.
- jclem 10y agoMakes sense, thanks. For some reason, I was set on parsing the "env" values into instances of the same class, regardless of what type they were in JSON, but it's not really necessary. I'll also look into writing custom converters, because I'll likely need that in the future.