Documents auto populated parameters It will remove any required marks for the parameter, remove the parameter from the example, and add a snippet about the parameter being autopopulated in the description.
(self, event_name, section, **kwargs)
| 131 | ) |
| 132 | |
| 133 | def document_auto_populated_param(self, event_name, section, **kwargs): |
| 134 | """Documents auto populated parameters |
| 135 | |
| 136 | It will remove any required marks for the parameter, remove the |
| 137 | parameter from the example, and add a snippet about the parameter |
| 138 | being autopopulated in the description. |
| 139 | """ |
| 140 | if event_name.startswith('docs.request-params'): |
| 141 | if self.name in section.available_sections: |
| 142 | section = section.get_section(self.name) |
| 143 | if 'is-required' in section.available_sections: |
| 144 | section.delete_section('is-required') |
| 145 | description_section = section.get_section( |
| 146 | 'param-documentation' |
| 147 | ) |
| 148 | description_section.writeln(self.param_description) |
| 149 | elif event_name.startswith('docs.request-example'): |
| 150 | section = section.get_section('structure-value') |
| 151 | if self.name in section.available_sections: |
| 152 | section.delete_section(self.name) |
| 153 | |
| 154 | |
| 155 | class HideParamFromOperations: |