()
| 44 | } |
| 45 | |
| 46 | func (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. |
| 63 | type StepAPIWithOptionalArgs struct { |
nothing calls this directly
no test coverage detected