Bert-R
8 years agoNew 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
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'
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.