Hi,<div><br></div><div>To add some more context, we actually have a situation in which by default the attribute Nachi is referring to (gateway_ip) is auto-generated, and we are looking for a solution to tell the API that the gateway IP should not be generated at all.</div>
<div>It could be argued that the right solution would probably be looking at the problem in a different way (e.g.: have "no gateway" as default behaviour)<br></div><div><br></div><div>However, for the specific issues Nachi raised, I have been unable to find so far similar cases in other Openstack projects. If this is confirmed, whatever is decided here might set a precedent, so it is worth dealing with this problem in an appropriate way. This might also be important for "update" scenarios in which we want to delete (or nullify) the value for a specific attribute, as most OS APIs use patch semantics for PUT operations.</div>
<div><br></div><div>My personal opinion is that I would avoid using values which are tantamount to 'magic values', such as the empty string. the string 'none', also is a magic value, although I have to admit it might be acceptable. My preferred choice at the moment is having:</div>
<div><br></div><div>"resource" : {</div><div>"nullable-attribute" : null</div><div>}</div><div><br></div><div>for JSON, and something like the following:</div><div><br></div><div><resource></div>
<div>  <nullable-attribute/></div><div></resource></div><div><br></div><div>for XML. I am not sure however whether this will work well with the current deserializers we have.</div><div><br></div><div>Assuming we will deal properly with patch semantics and nullable attributes in Grizzly, it also important IMHO that whatever choice we make here must not cause a backward incompatible API change in Grizzly.</div>
<div><br></div><div>Thanks,</div><div>Salvatore</div><div><br></div><div><br><div class="gmail_quote">On 6 August 2012 20:14, Nachi Ueno <span dir="ltr"><<a href="mailto:nachi@nttmcl.com" target="_blank">nachi@nttmcl.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks<br>
<br>
In quantum, we can specify None as a parameter value  ( In this case<br>
None is not default value ).<br>
How we design this spec?<br>
<br>
Design1:  "None" ( String) is only allowed with case sensitive.<br>
Design2:  null ( Json type ) ( This can't support XML )<br>
Design3:  Allow multiple way. ( None none null "" (empty string) )<br>
<br>
I wanna choose consistent way in OpenStack projects.<br>
<br>
# I think a PTL for API spec is do needed to maintain consistency<br>
between project...<br>
<br>
Nachi : NTT MCL<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div>