cancel
Showing results for 
Search instead for 
Did you mean: 

Editor full of resolver errors

SOLVED
Highlighted
New Contributor

Editor full of resolver errors

Hello everyone,

 

It has been a while since I visited Swagger Hub. Now I revisited our API and it happens to be full of errors of this type:

Resolver error

Cannot read property 'properties' of undefined

 

I have stripped down the API to just what is necessary to reproduce the issue. See https://app.swaggerhub.com/api/yonadev/YonaAppService/1.0.0

 

Does anybody know what's wrong with this? One of the ways to get rid of the issue is to remove the last two lines, but that's obviously not what I want.

 

Your help is appreciated!

Regards,

Bert

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Moderator

Re: Editor full of resolver errors

Hi Bert,

 

The error is here:

  PrivateUserData:
    allOf:
      - $ref: '#/definitions/PrivateUserDataNoVPN'
    properties:
      vpnProfile:
        $ref: '#/definitions/VPNProfile'

It should be:

  PrivateUserData:
    allOf:
      - $ref: '#/definitions/PrivateUserDataNoVPN'
      - type: object
properties: vpnProfile: $ref: '#/definitions/VPNProfile'

 

Also, there's no need for allOf in other schemas:

  PostPutUser:
    $ref: '#/definitions/PrivateUserData'

  VPNProfile:
    type: object
    description: VPN profile. Private data, only available after the mobile number is confirmed.
    properties:
      _links:
        $ref: '#/definitions/OvpnProfileLink'

Helen Kosova
SmartBear Documentation Team Lead
________________________
Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

Highlighted
Moderator

Re: Editor full of resolver errors

If you want to combine multiple definitions, you have to use 'allOf'.

 

          _links:
            allOf:
              - $ref: '#/definitions/Curies'
              - $ref: '#/definitions/SelfLink'
              - $ref: '#/definitions/EditLink'
              - $ref: '#/definitions/WeeklyActivityReportsLink'
              - $ref: '#/definitions/DailyActivityReportsLink'

That ^ would be the right approach in this case.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

4 REPLIES 4
Highlighted
Moderator

Re: Editor full of resolver errors

Hi Bert,

 

The error is here:

  PrivateUserData:
    allOf:
      - $ref: '#/definitions/PrivateUserDataNoVPN'
    properties:
      vpnProfile:
        $ref: '#/definitions/VPNProfile'

It should be:

  PrivateUserData:
    allOf:
      - $ref: '#/definitions/PrivateUserDataNoVPN'
      - type: object
properties: vpnProfile: $ref: '#/definitions/VPNProfile'

 

Also, there's no need for allOf in other schemas:

  PostPutUser:
    $ref: '#/definitions/PrivateUserData'

  VPNProfile:
    type: object
    description: VPN profile. Private data, only available after the mobile number is confirmed.
    properties:
      _links:
        $ref: '#/definitions/OvpnProfileLink'

Helen Kosova
SmartBear Documentation Team Lead
________________________
Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

New Contributor

Re: Editor full of resolver errors

Thanks Helena. That removes the errors. I tried removing the allOf in other places, but that gives new errors. 

 

For instance, I try to change this (line 2280):

 

          _links:
            allOf:
              - $ref: '#/definitions/Curies'
              - $ref: '#/definitions/SelfLink'
              - $ref: '#/definitions/EditLink'
              - $ref: '#/definitions/WeeklyActivityReportsLink'
              - $ref: '#/definitions/DailyActivityReportsLink'

 

 

Into that:

 

          _links:
            $ref: '#/definitions/Curies'
            $ref: '#/definitions/SelfLink'
            $ref: '#/definitions/EditLink'
            $ref: '#/definitions/WeeklyActivityReportsLink'
            $ref: '#/definitions/DailyActivityReportsLink'

 

I get:

Parser error

duplicated mapping key

 

Any idea?

Highlighted
Moderator

Re: Editor full of resolver errors

If you want to combine multiple definitions, you have to use 'allOf'.

 

          _links:
            allOf:
              - $ref: '#/definitions/Curies'
              - $ref: '#/definitions/SelfLink'
              - $ref: '#/definitions/EditLink'
              - $ref: '#/definitions/WeeklyActivityReportsLink'
              - $ref: '#/definitions/DailyActivityReportsLink'

That ^ would be the right approach in this case.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

Highlighted
New Contributor

Re: Editor full of resolver errors

That explains it. Thank you!

New Here?
Join us and watch the welcome video:
Announcements