Portal Management documentation - Swagger file reports an error

I‘ve uploaded a Swagger File into Portal Management documentation. While the Swagger file shows no error on „Swagger Hub:grinning:, Tyk Portal Management shows an error :open_mouth: at the bottom line:

{"messages":["malformed or unreadable swagger supplied"],"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"type","message":"instance type (string) does not match any allowed primitive type (allowed: [\"object\"])","schema":{"loadingURI":"#","pointer":""},"instance":{"pointer":""}}]}

The Swagger File can be found here:
Swagger File here

Can you please check, why Tyk Management Portal shows this error?

Hi!

Thanks for your message, I’ll have a look to see if I can reproduce this and get back to you :slight_smile:

Luan

I seem to also be getting an error although it’s not obvious why, I’ll have a look further to see what else I can find.

Hi,
in the meantime I had converted the swagger file to version 3.0 and uploaded it into Portal Management. The upgraded swagger file causes no error. I don’t know if this information will help you in finding the reason for the error message.

Thanks for the info, I’ve raised it with our engineering team and I’ll post any progress back here :slight_smile:

Just to clarify, how did you import the docs? Via the UI?
Where were you seeing the error message?

Thanks again,
Luan

This seems to be a bug specific to your particular docs, if you open a GH issue on the TykTechnologies/tyk repo you’ll be able to track the progress from there.

I’ve opened the swagger file in a text editor and copy / pasted it into the pop-up window in the UI. While inserting, there was no error message.

:confused: :confused: :confused: ??? - what is GH? … and what is a repo??? - I’m not a developer. :confused:

No problem, GH means GitHub :slight_smile: It looks like the issue you’re having is related to a bug we found yesterday, which you can follow here: Documentation upload fails if tab not selected first · Issue #1390 · TykTechnologies/tyk · GitHub

When uploading the docs you need to click on one of the tabs at the top (like “From Swagger File”) before you paste it into the box, otherwise you run into this bug.

Hope that helps :slight_smile:

Sounds promising, I’ve tested it just now. But this does not help me. :frowning_face: I can also remember that I’ve always clicked at the tab Attach documentation before I’ve pasted the code.

@Luan : I also observed following: When you view the code and error in Developer Portal and then click at the “swagger” logo, than …

Swagger click

… you will get to new page with this:

Maybe it helps you in finding the error.

Here is a video showing showing what I meant earlier, you need to click on the “From Swagger File” tab before pasting due to the bug I mentioned.
https://www.screencast.com/t/TIEABD5x

It was a little bit difficult to find out the url that is combined from API URL + Key + /documentation
But following your instruction screencast, I get the following:

Sorry I should have been clearer, don’t worry about the URL he pasted in, this was just a mistake as he had the wrong thing in his clipboard.

The important thing to note is just that you have to explicitly click on the “From Swagger File” tab first, and then you can paste in the original swagger file that you sent in the first post on here and it should work :slight_smile:

Here is the result using the code you sent in your first post:

I’ve attached the documentation and paid attention to click From Swagger File before inserting:
2018-01-10 16-11-46

But error still resist:

Interesting! It seems this goes deeper in that case… :male_detective:
What version of Tyk are you running? On Prem/Hybrid/Cloud?

I’m using Cloud Version.

Ok interesting, I’ve used the same code on Cloud and I’m not seeing any errors, so I’ve asked for input from the engineering team and I’ll get back to you once I hear from them again.

When you click on the red error link, what do you see? The same error text you quoted in your original post?

Indeed, interesting.
Yes, I get the error quoted in original post.