cancel
Showing results for 
Search instead for 
Did you mean: 

malformed or unreadable swagger supplied

SOLVED
Highlighted
New Contributor

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/talenyaext/1.0.1

can you please advise?

thanks

ramster

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: malformed or unreadable swagger supplied

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"

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: malformed or unreadable swagger supplied

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"

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: malformed or unreadable swagger supplied

gee, that was quick!! 🙂 thanks a lot.

I wonder why your validator did not point me there and just gave a general error

Highlighted
Moderator

Re: malformed or unreadable swagger supplied

That's a good question. I'll open a ticket internally about it so we can track it down.


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

Re: malformed or unreadable swagger supplied

I'm also having the same problem.  Other swagger validators say there are no error but Swagger Hub shows the "malformed or unreadable swagger supplied" message for the following document

 

https://app.swaggerhub.com/apis/jamesdbloom/mock-server_api/10.8.

 

Has there been any progress on why this error is not pointing to the problem?

 

 

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