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

a common function to get a string value of descendants of JSON_VALUE #23

Open
phgachoud opened this issue Mar 2, 2020 · 1 comment
Open

Comments

@phgachoud
Copy link
Contributor

Was wondering some time ago what method could I use for all the JSON_VALUE as string. As as far as I remember the representation doesn't give the same in each type, etc...

Is there already a common way I ignore?

Why not redefine the out method?

Thx for your point of view

@phgachoud phgachoud changed the title a common method to get a string value of descendants of JSON_VALUE a common function to get a string value of descendants of JSON_VALUE Mar 2, 2020
@jocelyn
Copy link
Member

jocelyn commented Mar 10, 2020

I guess we could add a
JSON_VALUE.to_unicode_string: STRING_32
and maybe also
JSON_VALUE.to_utf_8_string: STRING_8

With a precondition is_string
so for real it would apply only to JSON_STRING

as it looks dangerous to allow this for any json value ... as user will end up using it often ... and may be fooled by a string value "null" for instance ... without knowing for sure it is a JSON_NULL or else .

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

2 participants