Skip to content
Merged
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions example/openapi-petstore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
requires:
plugins:
- name: workflow-plugin-http
- name: workflow-plugin-openapi

modules:
# HTTP server on port 8095
- name: petstore-server
type: http.server
config:
address: ":8095"

# HTTP router — the OpenAPI module registers routes onto this
- name: petstore-router
type: http.router
dependsOn:
- petstore-server

# OpenAPI module — parses the spec and generates routes
- name: pet-store-api
type: openapi
dependsOn:
- petstore-router
config:
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example configuration uses a relative path "example/specs/petstore.yaml" for the spec_file on line 25. This path is relative to where the engine binary is executed from, which could cause confusion if the config is run from a different directory. Consider either using an absolute path, or documenting in a comment that paths are resolved relative to the config file's directory (via the _config_dir mechanism in config.ResolvePathInConfig).

Suggested change
config:
config:
# NOTE: spec_file is resolved relative to this config file's directory
# via the _config_dir mechanism in config.ResolvePathInConfig.

Copilot uses AI. Check for mistakes.
# NOTE: spec_file is resolved relative to this config file's directory
# via the _config_dir mechanism in config.ResolvePathInConfig.
spec_file: specs/petstore.yaml
base_path: /api/v1
router: petstore-router
validation:
request: true
response: false
swagger_ui:
enabled: true
path: /docs
97 changes: 97 additions & 0 deletions example/specs/petstore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
openapi: "3.0.0"
info:
title: Petstore API
version: "1.0.0"
description: A sample pet store API based on the OpenAPI 3.0 Petstore example

paths:
/pets:
get:
operationId: listPets
summary: List all pets
parameters:
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 100
responses:
"200":
description: A list of pets
"400":
description: Invalid request
post:
operationId: createPet
summary: Create a pet
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
minLength: 1
maxLength: 100
tag:
type: string
maxLength: 50
responses:
"201":
description: Null response
"400":
description: Validation error

/pets/{petId}:
get:
operationId: showPetById
summary: Info for a specific pet
parameters:
- name: petId
in: path
required: true
schema:
type: integer
responses:
"200":
description: Expected response to a valid request
"404":
description: Pet not found

/pets/{petId}/status:
put:
operationId: updatePetStatus
summary: Update pet status
parameters:
- name: petId
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- status
properties:
status:
type: string
enum:
- available
- pending
- sold
responses:
"200":
description: Updated
"400":
description: Invalid status
"404":
description: Pet not found
Loading
Loading