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 <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Better Saggi <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches