MCPcopy Create free account
hub / github.com/UiPath/uipathcli / parse

Method parse

parser/openapi_parser.go:338–351  ·  view source on GitHub ↗
(definitionName string, document openapi3.T)

Source from the content-addressed store, hash-verified

336}
337
338func (p OpenApiParser) parse(definitionName string, document openapi3.T) (*Definition, error) {
339 uri, err := p.getUri(document)
340 if err != nil {
341 return nil, fmt.Errorf("Error parsing server URL: %w", err)
342 }
343 formattedName := strings.Split(definitionName, ".")[0]
344 operations := []Operation{}
345 for path := range document.Paths.Map() {
346 pathItem := document.Paths.Find(path)
347 operations = append(operations, p.parsePath(formattedName, document, *uri, path, *pathItem)...)
348 }
349 summary, description := p.getDocumentText(formattedName, document)
350 return NewDefinition(definitionName, summary, description, operations), nil
351}
352
353func (p OpenApiParser) Parse(name string, data []byte) (*Definition, error) {
354 loader := openapi3.NewLoader()

Callers 1

ParseMethod · 0.95

Calls 5

getUriMethod · 0.95
parsePathMethod · 0.95
getDocumentTextMethod · 0.95
NewDefinitionFunction · 0.85
FindMethod · 0.80

Tested by

no test coverage detected