Change in vdsm[master]: Detect optional parameter syntax errors in JSON schema

nsoffer at redhat.com nsoffer at redhat.com
Thu Jan 2 20:13:23 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: Detect optional parameter syntax errors in JSON schema
......................................................................


Patch Set 3: -Code-Review

(1 comment)

....................................................
File vdsm_api/process-schema.py
Line 165:                         raise ValueError(
Line 166:                             'Description of %s optional parameter error:\n'
Line 167:                             '\tThe description of optional parameter "%s" '
Line 168:                             'should start with "#optional"' %
Line 169:                             (symbol['name'], name))
The real issue here is the need for both declaration and definition of the optional property. It does not make sense that we need mark a property twice.

We should change the schema format so the optional parameter property is defined only once, and if it is defined, the system will add the optional note to the description in post processing step.

For example:

    ##
    # @Foo:
    #
    # Description...
    #
    # @bar:          description of bar
    #
    ##
    {'type': 'Foo',                                       
      'data': {'*bar': 'str'}}   
    
After post processing (e.g. html):

    <dt>bar</dt>
    <dd>description of bar (optional)</dd>

This format can not such inconsistency.
Line 170:             else:
Line 171:                 # Just append it to the last one we added
Line 172:                 symbol[mode][last_arg] += ' ' + line
Line 173:         elif mode == 'info_return':


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94f92459ee8787780a54a510b6f8cc074fb2a235
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Better Saggi <bettersaggi at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list