MCPcopy Index your code
hub / github.com/httprunner/httprunner / ToAPI

Method ToAPI

hrp/step_api.go:46–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46func (path *APIPath) ToAPI() (*API, error) {
47 api := &API{}
48 apiPath := path.GetPath()
49 err := builtin.LoadFile(apiPath, api)
50 if err != nil {
51 return nil, err
52 }
53 // 1. deal with request body compatibility
54 convertCompatRequestBody(api.Request)
55 // 2. deal with validators compatibility
56 err = convertCompatValidator(api.Validators)
57 // 3. deal with extract expr including hyphen
58 convertExtract(api.Extract)
59 return api, err
60}
61
62// StepAPIWithOptionalArgs implements IStep interface.
63type StepAPIWithOptionalArgs struct {

Callers

nothing calls this directly

Calls 5

GetPathMethod · 0.95
LoadFileFunction · 0.92
convertCompatRequestBodyFunction · 0.85
convertCompatValidatorFunction · 0.85
convertExtractFunction · 0.85

Tested by

no test coverage detected