Update OpenAPI example documentation to support correct CORS headers for
HTTP streaming connections and include instructions for running Petstore
locally via `docker compose`.
Small quality-of-life improvement for editing example configs by
renaming `schema/local.json` to `schema/config.json`.
---
The YAML files have been formatted using a formatter that follows
Go/Kubernetes YAML indentation style. I can remove this formatting if
you prefer the change to be as minimal as possible.
* feat: Allow loading OpenAPI schemas from remote URLs
This change introduces the ability to specify OpenAPI schemas via remote URLs
in addition to local file paths for MCP OpenAPI targets.
Key changes:
- Updated `crates/agentgateway/proto/mcp/target.proto`:
- Modified `OpenAPITarget` to use a `oneof schema_source` which can be either
`local_schema` (using `common.LocalDataSource`) or `remote_schema`
(using `common.RemoteDataSource`).
- Updated `crates/agentgateway/src/outbound/openapi.rs`:
- Added an async function `load_openapi_schema` that takes an
`OpenAPITarget` protobuf and loads the schema.
- If `remote_schema` is specified, it fetches the schema from the URL
(supporting headers from `RemoteDataSource`).
- If `local_schema` is specified, it loads from the local path or inline bytes.
- Handles JSON and YAML formats, and includes error handling for network
issues, invalid URLs, and malformed content.
- Updated `ParseError` enum for more specific error reporting.
- Added comprehensive unit tests for `load_openapi_schema` covering
remote and local loading scenarios with `wiremock` and `tempfile`.
- Updated `crates/agentgateway/src/outbound.rs`:
- Modified the `outbound::OpenAPITarget` struct to store the raw
protobuf `schema_source` instead of pre-parsed tools and prefix.
- Its `TryFrom<XdsOpenAPITarget>` implementation now stores this
`schema_source` without immediate processing.
- Updated `crates/agentgateway/src/relay/pool.rs`:
- In `ConnectionPool::connect`, for `McpTargetSpec::OpenAPI`:
- It now calls the new `openapi::load_openapi_schema` with the
stored protobuf `schema_source`.
- After successfully loading, it calls `openapi::parse_openapi_schema`
and `openapi::get_server_prefix` to derive tools and the prefix.
- The `openapi::Handler` is then instantiated with these dynamically
derived values.
This enhancement provides greater flexibility in configuring OpenAPI targets
by allowing schemas to be hosted and fetched from remote locations.
* fixed up manualy
* remote works
* fmt
* dependency issue
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* wip
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
* color updates
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
* wip
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
* update the openapi inputs
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
---------
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
* dynamic-listeners
* move options out
* prepping to merge with main
* just need to figure out the host thing
* compiles
* rbac working
* rename otlp json name
* add backend_tls config
* fmt
* config multiple listeners
* all config files load properly
* validate examples parse properly in CI
* needs -B
* update example READMEs
* TLS README
* endpoints
* better serialization
* major-release-changes
* fix up some openapi stuff
* refactored for referecnes
* compiles and formatting
* add upstream headers
* getting there on schema
* compiles...
* refactor
* unit tests
* fmt
* compiles
* use released