Skip to content

docs: fix OpenAPI petstore example #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/docs/03-tools/03-openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ GPTScript will automatically and internally generate the necessary code to make
Here is an example that uses the OpenAPI [Petstore Example](https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yaml):

```yaml
Tools: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml
Tools: https://petstore.gptscript-demos.ai/openapi

List all the pets. After you get a response, create a new pet named Mark. He is a lizard.
List all the pets. What are the names of the dogs?
```

You can also use a local file path instead of a URL.
Expand All @@ -22,6 +22,11 @@ If no HTTPS server exists, it will choose the first HTTP server. Other protocols
GPTScript will also handle path- and operation-level server overrides, following the same logic of choosing the first HTTPS server it finds,
or the first HTTP server if no HTTPS server exists in the array.

If no servers are defined in the definition, and the definition was downloaded from a URL, GPTScript will use the host
in the URL as the server value. This is the case with the Petstore example above.

### Server Variables

Additionally, GPTScript can handle variables in the server name. For example, this:

```yaml
Expand Down