(comments []*ast.Comment, fileInfo *AstFileInfo)
| 1113 | } |
| 1114 | |
| 1115 | func (parser *Parser) parseRouterAPIInfoComment(comments []*ast.Comment, fileInfo *AstFileInfo) error { |
| 1116 | if parser.matchTags(comments) && matchExtension(parser.parseExtension, comments) { |
| 1117 | // for per 'function' comment, create a new 'Operation' object |
| 1118 | operation := NewOperation(parser, SetCodeExampleFilesDirectory(parser.codeExampleFilesDir)) |
| 1119 | for _, comment := range comments { |
| 1120 | err := operation.ParseComment(comment.Text, fileInfo.File) |
| 1121 | if err != nil { |
| 1122 | return fmt.Errorf("ParseComment error in file %s for comment: '%s': %+v", fileInfo.Path, comment.Text, err) |
| 1123 | } |
| 1124 | if operation.State != "" && operation.State != parser.HostState { |
| 1125 | return nil |
| 1126 | } |
| 1127 | } |
| 1128 | err := processRouterOperation(parser, operation) |
| 1129 | if err != nil { |
| 1130 | return err |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | return nil |
| 1135 | } |
| 1136 | |
| 1137 | func refRouteMethodOp(item *spec.PathItem, method string) (op **spec.Operation) { |
| 1138 | switch method { |
no test coverage detected