def _parseRawDoc(self, operation):
"""
Set doc fields of this operation by using the Documentation object
- If the Documentation object has a .yamlData property, we update values
of the operation properties from them. Unrecognized properties will
be added with the 'x-' prefix.
- Documentation.full is the description
- Documentation.first is the summary
"""
operation.summary = self.doco.first
operation.description = self.doco.full
if self.doco.yamlData:
fieldNames = [f.name for f in attr.fields(operation.__class__)]
for k in self.doco.yamlData:
if k in fieldNames:
setattr(operation, k, self.doco.yamlData[k])
else:
operation._extended['x-' + k] = self.doco.yamlData[k]
评论列表
文章目录