-
Notifications
You must be signed in to change notification settings - Fork 77
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 attribute value to string? #125
Comments
its the job of the serializer functions to convert whatever type you have to a string. even if it can be achieved via a simple string cast, it would IMO be better to have this kind of code explicitly written in a serializer instead of doing it implicitly in the framework/lib. |
What if you're only passing an array of data through to the |
casting such a array to a string would also not produce the xml you expect, so this wouldn't help either? could you show a use case in which your initial assumption makes sense to you? |
Personally I think we should accept all scalars here... it makes kinda sense to me. |
I agree with supporting scalars but not complex types |
String is a scalar. Does that mean you're willing to do this? |
To be honest I did not read the initially posted value carefully and assumed the error is about writing a array/object. Writing a scalar like int,string,float makes sende though. |
When passing an attribute that is a non-string value,
writeAttribute
throws an exception:Would it not be ideal to simply cast the value as a string and avoid the exception? This makes the API way more developer friendly IMHO.
The text was updated successfully, but these errors were encountered: