Forum Discussion

ramster's avatar
ramster
New Contributor
8 years ago

malformed or unreadable swagger supplied

My document looks ok and verifies as a valid YAML/Json However, I get from swaggerhub editor a "malformed or unreadable swagger supplied" this is my api: https://app.swaggerhub.com/api/redramster/...
  • RonRatovsky's avatar
    8 years ago

    Okay, that one was a bit tricky. Under your Employer definition you have:

     

     

        locations:
            type: "array"
            items:  {
              $ref: "/definitions/Location"
            }

     

    It should actually be (notice the extra #):

     

        locations:
            type: "array"
            items:  {
              $ref: "#/definitions/Location"
            }

    That should solve the issue.

    Also, if you want to utilize YAML to the fullest, you can write it all as:

     

        locations:
            type: array
            items: 
              $ref: "#/definitions/Location"