Open GoogleCodeExporter opened 9 years ago
This is unfortunately not a trivial implementation. My original logic was to do
something like:
set{% camel_case param.wireName %}(com.google.api.client.util.Data.NULL_{{
param.codeType|upper }});
but this does not work because the type of the parameter may not be a primitive
type. Eg: For one parameter I ran into List<String>.
I also think it is not that hard for users to figure out
resource.setComment(Data.NULL_STRING) but to help them out we could (only for
Patch methods) generate an additional comment in the javadoc pointing them to
com.google.api.client.util.Data for JSON null values.
What do you think?
Original comment by rmis...@google.com
on 9 Apr 2012 at 2:42
In general you can call Data.nullOf() to get the JSON null object for any type.
I do think it is hard for users to figure it out. As you say, this is
"unfortunately not trivial".
Adding a comment to the JavaDoc is reasonable, but my concern is that:
1. Developers often don't read JavaDoc so are less likely to discover it
2. If you do know how it works, it is human nature to accidentally call
setComment(null) when you meant to call setComment(Data.NULL_STRING).
I do see the down-side of adding more clutter in terms of extra generated
methods. This is particularly true in the case where a field cannot be
modified. We may be able to solve this problem though: there are plans to add
information in Discovery about which fields are modifiable. Perhaps we should
wait for that before implementing deleteX()?
Original comment by yan...@google.com
on 10 Apr 2012 at 12:17
Yes it makes sense to wait for that before implementing deleteX(), we do not
want to provide deleteX() if X cannot be modified, this will lead to confusion.
Do not see how to mark that we have a dependency for this bug, lowering
priority instead.
Original comment by rmis...@google.com
on 16 Apr 2012 at 12:16
Original comment by rmis...@google.com
on 16 May 2012 at 1:24
Original comment by rmis...@google.com
on 30 May 2012 at 7:26
Original comment by yan...@google.com
on 2 Aug 2012 at 2:38
Original comment by yan...@google.com
on 26 Sep 2012 at 12:43
Original issue reported on code.google.com by
yan...@google.com
on 6 Apr 2012 at 9:03