Error when referencing parameters via Open API yaml Specification

Getting an Error when Creating Plugin with OpenApi Spec, with parameter’s definition.
While via Open API Specification, we should be able to reference components under #/components/parameters .

Error is: In ${Path}, method **get**, operationId **getUserById**, parameter userId has location header; ignoring.

I get this Error every time when trying to create a Plugin in front of My API.
Yaml (which is pretty lean), seems to be correct & validated through multiple yaml validations websites…

It seems like Open AI Plugin do not refer Open Api Specification as it should, and alerts on Errors which is not the real case here.

Any Help would be appreciated here :pray:

This says that the userId must come in a header, and apparently OpenAI doesn’t support parameters in headers in their plugin implementation.
OpenAPI is a very large specification, and most systems don’t support all of it. A developer has to choose the most common bits to support, and then return informative errors (like this one) for the cases that don’t work.
So, your choice is to “wait and see if at some point they support this,” or “add URL parameter as another optional location of the userId parameter.”

1 Like

Thanks for quick answer Jwatte! :pray:
When you say: “ apparently OpenAI doesn’t support parameters in headers in their plugin implementation.”
Is this assumption is based on some AI documentation or you assume from the Error message?
Thanks :grinning:

I think it’s just in the error message - I haven’t seen it documented anywhere.

@jwatte @iamflimflam1 Ok, I played with the Open API Definitions a bit more.
After few testing, I see that it isn’t actually related specifically to header as much as it’s related to referencing parameters.

In all My Open API Spec:

  • Those references working well: #/components/schemas/${schemaName}.
    E.G: #/components/schemas/Name
  • Those references alert an error: #/components/parameters/${parameterName}.
    E.G: #/components/parameters/page

No matter if the parameter is part of the Header or not.
I strongly believe that Plugin doesn’t know how to process parameters references rather than schemas.

Just looking at my yaml - I only have references used for return objects.

@iamflimflam1 which I guess are “schema” type. E.G:
$ref: '#/components/schemas/... right?

Yes, that’s right:

I must admit, I just asked ChatGPT to generate it for me…

1 Like