Referencing Domain defined parameter in OpenAPI 3.0
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Referencing Domain defined parameter in OpenAPI 3.0
I'm trying to define a parameter in a Domain, then use that common paramter in an API's parameters block. Doesn't seem to be working. The Domain and API are both OpenAPI v3.0.
In Domain:
...
####################
# Common parameters
####################
parameters:
MyCommonParameter:
in: query
name: "MyParameter"
description: "My common paramter."
required: false
schema:
type: string
enum:
- "1"
...
In the api def:
...
parameters:
- $ref: 'https://api.swaggerhub.com/domains/mine/mymodels/1.0#/components/parameters/MyCommonParameter'
...
It seems to work when viewing the documentation, but the api edit page, at the top, shows: "1 x Integrations Errors". Still saves, still works. Seems like a bug in the editor, but want to make sure I'm using it as expected.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @WilliamWilliams
Can you provide a "real" link to your parameters. It looks like a fake one.
Actually, the integrations error is usually occurs when such ref is not defined correctly
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately it's for a bank, can't expose the parameters or endpoints. :s Yes, normally if the reference is bad it shows on the line where the error occurs. In my case it was showing at the top of the page. Everything validated correctly, testing out the endpoint worked, everything was happy but the error still showed above the code editor area.
I tried closing the window, reopening, going to a different page, etc and it persisted. Looking at it now it's gone. Apparently a UI bug. :s
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparently it's something else. Seems to be working fine.
