Forum Discussion

WilliamWilliams's avatar
WilliamWilliams
Occasional Contributor
2 years ago
Solved

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.

 

  • Apparently it's something else.  Seems to be working fine.

3 Replies

  • WilliamWilliams's avatar
    WilliamWilliams
    Occasional Contributor

    Apparently it's something else.  Seems to be working fine.

  • chichepo's avatar
    chichepo
    Champion Level 3

    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

     

     

    • WilliamWilliams's avatar
      WilliamWilliams
      Occasional Contributor

      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