Not sure if this is the right place to report problems, but here we go.
As per OpenAPI spec, parameters should be able to reference components under #/components/parameters
, like so:
openapi: 3.1.0
info:
title: Sample API
description: This is a sample API
version: 1.0.0
paths:
/sample-path:
get:
operationId: getSampleItem,
summary: Returns a single item
parameters:
- $ref: '#/components/parameters/ItemId'
responses:
'200':
description: A single item
content:
application/json:
schema:
type: object
properties:
id:
type: integer
name:
type: string
components:
parameters:
ItemId:
in: query
name: itemId
required: true
description: The ID of the item
schema:
type: integer
Unfortunately, when trying to add a plugin that uses parameter references in it’s OpenAPI spec, you’ll get a warning like this:
In path /sample-path, method get, operationId getSampleItem, parameter {'$ref': '#/components/parameters/ItemId'} is has missing or non-string name; skipping
If you add a name, it’ll complain about the in
property and so on. Do ChatGPT plugins only support a subset of the OpenAPI spec or is this a bug?