Skip to content

Commit 6c26410

Browse files
authored
feat: use an OpenAPI definition as a tool file (#195)
Signed-off-by: Grant Linville <[email protected]>
1 parent bc67d22 commit 6c26410

File tree

18 files changed

+1082
-124
lines changed

18 files changed

+1082
-124
lines changed

docs/docs/03-tools/01-using.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,34 @@ Select a number at random between 1 and 100 and return only the number.
3535
```
3636

3737
### External Tools
38+
You can refer to GPTScript tool files that are served on the web or stored locally. This is useful for sharing tools across multiple scripts or for using tools that are not part of the core GPTScript distribution.
3839

39-
This is where the real power of GPTScript starts to become evident. For this example lets use the external [image-generation](https://github.com/gptscript-ai/image-generation) and [search](https://github.com/gptscript-ai/search) tools to generate an image and then search the web for similar images.
40+
```yaml
41+
tools: https://get.gptscript.ai/echo.gpt
42+
43+
Echo the phrase "Hello, World!".
44+
```
45+
46+
Or, if the file is stored locally in "echo.gpt":
47+
48+
```yaml
49+
tools: echo.gpt
50+
51+
Echo the phrase "Hello, World!".
52+
```
53+
54+
You can also refer to OpenAPI definition files as though they were GPTScript tool files. GPTScript will treat each operation in the file as a separate tool. For more details, see [OpenAPI Tools](03-openapi.md).
4055

41-
:::note
42-
There will be better packaging and distribution for external tools in the future. For now, this assumes you have the tools cloned locally and are pointing to their repos directly.
43-
:::
56+
### Packaged Tools on GitHub
57+
GPTScript tools can be packaged and shared on GitHub, and referred to by their GitHub URL. For example:
4458

4559
```yaml
46-
tools: ./image-generation/tool.gpt, ./vision/tool.gpt, sys.read
60+
tools: github.com/gptscript-ai/image-generation, github.com/gptscript-ai/vision, sys.read
4761

4862
Generate an image of a city skyline at night and write the resulting image to a file called city_skyline.png.
4963

5064
Take this image and write a description of it in the style of pirate.
5165
```
5266

53-
External tools are tools that are defined by a `tool.gpt` file in their root directory. They can be imported into a GPTScript by specifying the path to the tool's root directory.
67+
When this script is run, GPTScript will locally clone the referenced GitHub repos and run the tools referenced inside them.
68+
For more info on how this works, see [Authoring Tools](02-authoring.md).

docs/docs/03-tools/03-openapi.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# OpenAPI Tools
2+
3+
:::note
4+
This is a new feature and might be buggy.
5+
:::
6+
7+
GPTScript can treat OpenAPI v3 definition files as though they were tool files.
8+
Each operation (a path and HTTP method) in the file will become a simple tool that makes an HTTP request.
9+
GPTScript will automatically and internally generate the necessary code to make the request and parse the response.
10+
11+
Here is an example that uses the OpenAPI [Petstore Example](https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yaml):
12+
13+
```yaml
14+
Tools: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml
15+
16+
List all the pets. After you get a response, create a new pet named Mark. He is a lizard.
17+
```
18+
19+
You can also use a local file path instead of a URL.
20+
21+
## Servers
22+
23+
GPTScript will look at the top-level `servers` array in the file and choose the first HTTPS server it finds.
24+
If no HTTPS server exists, it will choose the first HTTP server. Other protocols (such as WSS) are not yet supported.
25+
26+
GPTScript will also handle path- and operation-level server overrides, following the same logic of choosing the first HTTPS server it finds,
27+
or the first HTTP server if no HTTPS server exists in the array.
28+
29+
Additionally, GPTScript can handle variables in the server name. For example, this:
30+
31+
```yaml
32+
servers:
33+
- url: '{server}/v1'
34+
variables:
35+
server:
36+
default: https://api.example.com
37+
```
38+
39+
Will be resolved as `https://api.example.com/v1`.
40+
41+
## Authentication
42+
43+
GPTScript currently ignores any security schemes and authentication/authorization information in the OpenAPI definition file. This might change in the future.
44+
45+
For now, the only supported type of authentication is bearer tokens. GPTScript will look for a special environment variable based
46+
on the hostname of the server. It looks for the format `GPTSCRIPT_<HOST>_BEARER_TOKEN`, where `<HOST>` is the hostname, but in all caps and
47+
dots are replaced by underscores. For example, if the server is `https://api.example.com`, GPTScript will look for an environment variable
48+
called `GPTSCRIPT_API_EXAMPLE_COM_BEARER_TOKEN`. If it finds one, it will use it as the bearer token for all requests to that server.
49+
50+
:::note
51+
GPTScript will not look for bearer tokens if the server uses HTTP instead of HTTPS.
52+
:::
53+
54+
## MIME Types and Request Bodies
55+
56+
In OpenAPI definitions, request bodies are described with a MIME type. Currently, GPTScript supports these MIME types:
57+
- `application/json`
58+
- `text/plain`
59+
- `multipart/form-data`
60+
61+
GPTScript will return an error when parsing the OpenAPI definition if it finds a request body that does not specify
62+
at least one of these supported MIME types.

go.mod

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,23 @@ require (
1111
github.com/acorn-io/cmd v0.0.0-20240203032901-e9e631185ddb
1212
github.com/adrg/xdg v0.4.0
1313
github.com/fatih/color v1.16.0
14+
github.com/getkin/kin-openapi v0.123.0
1415
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
1516
github.com/hexops/autogold/v2 v2.1.0
1617
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
1718
github.com/mholt/archiver/v4 v4.0.0-alpha.8
1819
github.com/olahol/melody v1.1.4
1920
github.com/rs/cors v1.10.1
2021
github.com/samber/lo v1.38.1
21-
github.com/sashabaranov/go-openai v1.20.1
22+
github.com/sashabaranov/go-openai v1.20.4
2223
github.com/sirupsen/logrus v1.9.3
2324
github.com/spf13/cobra v1.8.0
2425
github.com/stretchr/testify v1.8.4
26+
github.com/tidwall/gjson v1.17.1
2527
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc
2628
golang.org/x/sync v0.6.0
2729
golang.org/x/term v0.16.0
30+
gopkg.in/yaml.v3 v3.0.1
2831
)
2932

3033
require (
@@ -38,6 +41,8 @@ require (
3841
github.com/davecgh/go-spew v1.1.1 // indirect
3942
github.com/dsnet/compress v0.0.1 // indirect
4043
github.com/go-logr/logr v1.4.1 // indirect
44+
github.com/go-openapi/jsonpointer v0.20.2 // indirect
45+
github.com/go-openapi/swag v0.22.8 // indirect
4146
github.com/golang/snappy v0.0.4 // indirect
4247
github.com/google/go-cmp v0.6.0 // indirect
4348
github.com/google/go-containerregistry v0.16.1 // indirect
@@ -48,33 +53,39 @@ require (
4853
github.com/hexops/gotextdiff v1.0.3 // indirect
4954
github.com/hexops/valast v1.4.3 // indirect
5055
github.com/inconshreveable/mousetrap v1.1.0 // indirect
56+
github.com/invopop/yaml v0.2.0 // indirect
57+
github.com/josharian/intern v1.0.0 // indirect
5158
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
5259
github.com/klauspost/compress v1.16.5 // indirect
5360
github.com/klauspost/pgzip v1.2.5 // indirect
61+
github.com/mailru/easyjson v0.7.7 // indirect
5462
github.com/mattn/go-colorable v0.1.13 // indirect
5563
github.com/mattn/go-isatty v0.0.20 // indirect
5664
github.com/mattn/go-runewidth v0.0.10 // indirect
5765
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
66+
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
5867
github.com/nightlyone/lockfile v1.0.0 // indirect
5968
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
6069
github.com/olekukonko/tablewriter v0.0.6-0.20230925090304-df64c4bbad77 // indirect
6170
github.com/onsi/ginkgo/v2 v2.13.0 // indirect
6271
github.com/onsi/gomega v1.29.0 // indirect
72+
github.com/perimeterx/marshmallow v1.1.5 // indirect
6373
github.com/pierrec/lz4/v4 v4.1.15 // indirect
6474
github.com/pmezard/go-difflib v1.0.0 // indirect
6575
github.com/rivo/uniseg v0.1.0 // indirect
6676
github.com/samber/slog-logrus v1.0.0 // indirect
6777
github.com/spf13/pflag v1.0.5 // indirect
6878
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
6979
github.com/therootcompany/xz v1.0.1 // indirect
80+
github.com/tidwall/match v1.1.1 // indirect
81+
github.com/tidwall/pretty v1.2.0 // indirect
7082
github.com/ulikunitz/xz v0.5.10 // indirect
7183
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
7284
golang.org/x/mod v0.15.0 // indirect
7385
golang.org/x/net v0.20.0 // indirect
7486
golang.org/x/sys v0.16.0 // indirect
7587
golang.org/x/text v0.14.0 // indirect
7688
golang.org/x/tools v0.17.0 // indirect
77-
gopkg.in/yaml.v3 v3.0.1 // indirect
7889
k8s.io/klog/v2 v2.110.1 // indirect
7990
mvdan.cc/gofumpt v0.6.0 // indirect
8091
sigs.k8s.io/controller-runtime v0.16.3 // indirect

go.sum

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,21 @@ github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4Nij
6666
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
6767
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
6868
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
69+
github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8=
70+
github.com/getkin/kin-openapi v0.123.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM=
6971
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
7072
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
7173
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
7274
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
7375
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
76+
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
77+
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
78+
github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw=
79+
github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI=
7480
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
7581
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
82+
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
83+
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
7684
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
7785
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
7886
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -138,8 +146,12 @@ github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4Dvx
138146
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
139147
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
140148
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
149+
github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY=
150+
github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
141151
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 h1:iCHtR9CQyktQ5+f3dMVZfwD2KWJUgm7M0gdL9NGr8KA=
142152
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk=
153+
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
154+
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
143155
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
144156
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
145157
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
@@ -159,6 +171,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
159171
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
160172
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
161173
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
174+
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
175+
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
162176
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
163177
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
164178
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
@@ -175,6 +189,8 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1f
175189
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
176190
github.com/mholt/archiver/v4 v4.0.0-alpha.8 h1:tRGQuDVPh66WCOelqe6LIGh0gwmfwxUrSSDunscGsRM=
177191
github.com/mholt/archiver/v4 v4.0.0-alpha.8/go.mod h1:5f7FUYGXdJWUjESffJaYR4R60VhnHxb2X3T1teMyv5A=
192+
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
193+
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
178194
github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAmxBiA=
179195
github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI=
180196
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk=
@@ -187,6 +203,8 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4
187203
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
188204
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
189205
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
206+
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
207+
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
190208
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
191209
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
192210
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -225,6 +243,14 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
225243
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
226244
github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw=
227245
github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY=
246+
github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U=
247+
github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
248+
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
249+
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
250+
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
251+
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
252+
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
253+
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
228254
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
229255
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
230256
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
@@ -422,6 +448,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
422448
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
423449
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
424450
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
451+
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
425452
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
426453
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
427454
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

pkg/engine/engine.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ func (e *Engine) Start(ctx Context, input string) (*Return, error) {
185185
return e.runHTTP(ctx.Ctx, ctx.Program, tool, input)
186186
} else if tool.IsDaemon() {
187187
return e.runDaemon(ctx.Ctx, ctx.Program, tool, input)
188+
} else if tool.IsOpenAPI() {
189+
return e.runOpenAPI(tool, input)
188190
}
189191
s, err := e.runCommand(ctx.Ctx, tool, input)
190192
if err != nil {

0 commit comments

Comments
 (0)