MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / parseOpenAPI3

Function parseOpenAPI3

mcp-server/openapi.go:38–54  ·  view source on GitHub ↗
(spec *openapi3.T)

Source from the content-addressed store, hash-verified

36}
37
38func 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
56var (
57 validMethods = []string{

Callers 1

Calls 2

genAPIsFunction · 0.85
MapMethod · 0.65

Tested by

no test coverage detected