petstore
Call the Swagger Petstore API. A sample API that uses a petstore as an example to demonstrate api2skill.
- License 许可
- MIT
- 最近更新
- 2026-10-31
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- petstore
- description
- Call the Swagger Petstore API. A sample API that uses a petstore as an example to demonstrate api2skill.
02 资源文件 11
- 参考文档.api2skill.json326 B
- 其他.gitignore52 B
- 参考文档reference/default.md197 B
- 参考文档reference/pet.md5.1 KB
- 参考文档reference/schemas/Category.json231 B
- 参考文档reference/schemas/Pet.json670 B
- 参考文档reference/schemas/PetInput.json561 B
- 参考文档reference/schemas/Tag.json221 B
- 参考文档reference/store.md266 B
- 脚本scripts/call.csx40.9 KB
- 参考文档secrets.example.json354 B
03 SKILL.md 正文
Swagger Petstore
A sample API that uses a petstore as an example to demonstrate api2skill.
Overview
Base URL: https://petstore.example.com/v2
Setup
Runner: dotnet script scripts/call.csx --
Copy secrets.example.json to secrets.json and fill in real credentials before calling authenticated operations. secrets.json is gitignored — never commit it.
Untrusted HTTPS (self-signed/invalid certificates) is off by default. Set API2SKILL_INSECURE=1 to accept them — dev/local use only, never in production.
Auth (from the spec)
| scheme | kind | secrets.json keys |
|---|---|---|
api_key |
ApiKey | apiKey |
petstore_auth |
OAuth2 | clientId, clientSecret, tokenUrl |
How to call
dotnet script scripts/call.csx -- <operationId> [--<param> <value> ...] [--body <json|@file>]
Authored examples
Optional request/response payloads live under examples/<operationId>/<name>/ (request.json and/or response.json). Tag markdown in reference/ links them. Skills ship with no examples until you add them.
Prefer authored examples
When calling or testing an operation:
- Look under
examples/<operationId>/for named examples. - If one name → use its
request.jsonas--body(or equivalent). - If several → ask the user which
nameto use (or pickdefaultif present and the user did not specify). - Do not invent a JSON body when an authored request example exists, unless the user explicitly overrides.
Failure protocol (mandatory)
If a call that used an authored example fails (non-success HTTP, auth error, unexpected body):
- Ask the user whether the example should be updated.
- Optionally propose a concrete patch to
request.json/response.jsonand/or a contract (OpenAPI / auth) change. - Do not apply any write to examples or contracts until the user explicitly approves.
- Never “fix forward” by silently overwriting examples.
Adding examples (chat or CLI)
- Create
examples/<operationId>/<name>/request.jsonand/orresponse.json(secret-free payloads only). - Run
api2skill example sync --skill .(orapi2skill example add --skill . --op <operationId> --name <name> --request …). - Confirm
reference/<tag>.mdlists the example under Authored examples.
Operations
pet
Everything about your Pets
| operationId | method | path | summary | reference |
|---|---|---|---|---|
findPetsByStatus |
GET | /pet/findByStatus |
Finds Pets by status | reference/pet.md |
getPetById |
GET | /pet/{petId} |
Find pet by ID | reference/pet.md |
addPet |
POST | /pet |
Add a new pet to the store | reference/pet.md |
store
Access to Petstore orders
| operationId | method | path | summary | reference |
|---|---|---|---|---|
get_store_inventory |
GET | /store/inventory |
Returns pet inventories by status | reference/store.md |
default
| operationId | method | path | summary | reference |
|---|---|---|---|---|
get_health |
GET | /health |
Health check (no tag, no auth) | reference/default.md |
04 同仓库更多 Skills
petstore
Call the Swagger Petstore API. A sample API that uses a petstore as an example to demonstrate api2skill.
petstore
Call the Swagger Petstore API. A sample API that uses a petstore as an example to demonstrate api2skill.
api2skill-creator
Interview the user about an OpenAPI/Swagger API (including multi-spec, base URL, and authorization), assemble exact api2skill CLI commands, guide secrets.json setup, and migrate existing generated skills after api2skill upgrades (update / regenerate / merge). Prefer Plan mode for multi-spec interviews and migrations.
speckit-taskstoissues
Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.
speckit-tasks
Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
speckit-specify
Create or update the feature specification from a natural language feature description.