(spec *openapi3.T)
| 36 | } |
| 37 | |
| 38 | func parseOpenAPI3(spec *openapi3.T) (*MCPInfo, error) { |
| 39 | items := spec.Paths.Map() |
| 40 | apis := make([]*API, 0, len(items)*4) |
| 41 | for path, item := range items { |
| 42 | pathApis, err := genAPIs(path, item) |
| 43 | if err != nil { |
| 44 | return nil, err |
| 45 | } |
| 46 | apis = append(apis, pathApis...) |
| 47 | } |
| 48 | |
| 49 | return &MCPInfo{ |
| 50 | Name: spec.Info.Title, |
| 51 | Description: spec.Info.Description, |
| 52 | Apis: apis, |
| 53 | }, nil |
| 54 | } |
| 55 | |
| 56 | var ( |
| 57 | validMethods = []string{ |
no test coverage detected