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?
1 Like
Happens to me as well, when trying to work with open API spec which has parameters.
My Spec is pretty lean, and when I tested via many open API Specification validators online, It says that my Spec is Valid.
Any suggestions someone?
Yeah I ran into the same problem. Bumping the issue
1 Like
I’m also running into this issue, references to parameters don’t work.
References to schemas and also responses work fine.
Adding the parameter spec directly to the path spec doesn’t give an error, so the parameter is correct and valid.
Things like pagination and other parameters are common to all endpoints, so it’s not ideal to have to add them to every path.
Hopefully this will receive some attention and get fixed.
4 Likes