Forum Discussion

Bert-R's avatar
Bert-R
New Contributor
8 years ago

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 un...
  • HKosova's avatar
    8 years ago

    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'
  • RonRatovsky's avatar
    RonRatovsky
    8 years ago

    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.