Juan Hernandez has posted comments on this change.

Change subject: restapi: Implement custom properties using elements
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.ovirt.org/#/c/27316/1/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd:

Line 2550:       <xs:element name="name" type="xs:string" minOccurs="1" 
maxOccurs="1"/>
Line 2551:       <xs:element name="value" type="xs:string" minOccurs="1" 
maxOccurs="1"/>
Line 2552:     </xs:sequence>
Line 2553:   </xs:complexType>
Line 2554: 
> 3. better abstraction for property element :-)
The comments from Moti and Gilad make a lot of sense, but the real reason for 
needing an element is that users of the Python SDK may want to locate the 
generated "Property" class using the "property" element. If the element 
declaration doesn't exist this isn't possible. Not a big issue, as users don't 
do this usually, but worth doing.

When adding the xs:annotation please put it as a nested element inside 
xs:element:

  <xs:complexType name="Properties">
    <xs:element ref="property" ...>
      <xs:annotation>
        ...
      </xs:annotation>
    </xs:element>
  </xs:complexType>

It is less prone to errors like this:

  <xs:sequence>
    <xs:annotation>
      <xs:appinfo>
        <jaxb:property name="Properties"/>
       </xs:appinfo>
     </xs:annotation>
     <!-- The method for this new element in Java will be getProperties(): -->
     <xs:element ref="newelement" .../>
     <!-- And this will be getProperty(): -->
     <xs:element ref="property" .../>
  </xs:sequence>
Line 2555:   <xs:element name="properties" type="Properties"/>
Line 2556: 
Line 2557:   <xs:complexType name="Properties">
Line 2558:     <xs:sequence>


-- 
To view, visit http://gerrit.ovirt.org/27316
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I03173b72b4f9ab2906ca9a2989d6115efcb19264
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to