Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎04-20-2017
Accepted Solution

Apparent resolver errors when referencing a Domain

I have an API that contains a reference to a definition in a domain that itself contains references to other definitions in that same domain. E.g.:

 

schema:
  type: object
  required:
    - self
    - parent
  foo:
    bar:
      $ref: 'https://api.swaggerhub.com/domains/myTeam/Bar/1.0.0-alpha#/definitions/Bar'

  ...

 

The Bar definition in the Bar domain refers to several other definitions in the Bar domain, and the Bar domain validates.

 

Now, for some reason, when I first load the API definition, the UI complains about some of the references in the Bar definition and marks my API definition as invalid. There's a workaround, though: if I just cut and repaste the $ref line above, those errors go away and the API definition validates. But if I reload the page, there the errors are again.

 

We use SH to communicate w/ outside partners, and even if I could explain the workaround to them, not all of them can edit the definitions. So all they see is this mass of errors when they load the page, which is totally unacceptable. Can you please tell me how to fix or avoid this?

 

The API in question is private, so I don't feel like sharing the link here, but for staff users, my SH username is 'jboyd'. Thanks!

Moderator
Posts: 65
Registered: ‎09-19-2015

Re: Apparent resolver errors when referencing a Domain

Hi Jboyd,

Domains with self-references are certainly supported, so there must be something that the editor isn't understanding.  Could you please add "swaggerhub-support" as a collaborator to your API and your domain so we can look into it?

 

Thank you!

Tony

-----
Tony Tam
SmartBear VP of Swagger Products
New Contributor
Posts: 4
Registered: ‎04-20-2017

Re: Apparent resolver errors when referencing a Domain

Done. Thanks!

Moderator
Posts: 65
Registered: ‎09-19-2015

Re: Apparent resolver errors when referencing a Domain

Got it, I'm looking.  BTW a simple version of domains referencing themselves can be seen here:

 

https://app.swaggerhub.com/apis/fehguy/demo-api/1.0.1

 

I have a feeling something else is tripping up the resolver.  I'm looking into it...

-----
Tony Tam
SmartBear VP of Swagger Products
New Contributor
Posts: 4
Registered: ‎04-20-2017

Re: Apparent resolver errors when referencing a Domain

Oh, I believe it generally works because 1) the UI shows things correctly as long as I hide the errors, and 2) the workaround works. I've seen this a couple times before and just shrugged it off, but with half a dozen errors showing I figured it was time to get y'all involved.

 

Thanks for the quick investigation!

Staff
Posts: 26
Registered: ‎06-14-2016

Re: Apparent resolver errors when referencing a Domain

Hi jboyd-

 

I'm Fernando Mattos, Product Manager for SwaggerHub. Just to let you know that we pushed a hotfix today to resolve the problem above. We've verified it against your API and we cannot reproduce the problem anymore.

 

Please let us know if this solves the issue and if you need any further help.

 

Regards,

Fernando

 

New Contributor
Posts: 4
Registered: ‎04-20-2017

Re: Apparent resolver errors when referencing a Domain

I've verified we're no longer seeing the issue. Thanks for the rapid response!