Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request type drop down for text/csv strange behavior can it be altered ? #1320

Closed
codemonkeyneo opened this issue May 28, 2015 · 3 comments
Closed

Comments

@codemonkeyneo
Copy link

I have swagger UI @Version v2.1.0-M2 with the Try it Out button enabled and the Response Content Type select has the available response types available.

Requesting json or xml format is great ; If I look at the network traffic it sends everything correctly

/GET myservicename.json
/GET myservicename.xml

The format extensions have nicely been appended to the service name.

HOWEVER,

If I choose text/csv I end up with an internal server error and a UI that just shows the progress dots looping.

Looking at the network traffic it shows ;

/GET myservicename.%7Bformat%7D?

Yikes that doesn't look correct.

How can I correctly give the content type the correct format to use so that I end up calling with the correct format.

i.e. /GET myservicename.csv

Thanks

@ponelat
Copy link
Member

ponelat commented May 28, 2015

From what I've seen, we're only supporting .json and .xml with the {format} URL placeholder ( {format} === %7Bformat%7D when it's URI is encoded).

To support more, we'd either need to add more manually (there shouldn't be that many) or map mime types to file extensions. CSV should be quite common, so this may need to be added soon.

However we continue, at the very least if we don't support that mime-type, we should strip out the {format} part.

So we'll have to see how we continue.

@webron webron added this to the v2.1 milestone May 28, 2015
@codemonkeyneo
Copy link
Author

Cool thanks for that ponelat and webron.

In the meantime I have simply removed those options for my users with a quick jquery remove();

$("select[name='responseContentType'] option[value='text/csv']").remove();
$("select[name='responseContentType'] option[value='text/html']").remove();
$("select[name='responseContentType'] option[value='text/plain']").remove();

@webron webron modified the milestones: v2.1, v2.1.1 Jun 8, 2015
@webron webron modified the milestones: v2.1.1, v2.1.2 Jul 31, 2015
@webron webron modified the milestones: v2.1.2, v2.1.3 Sep 2, 2015
@fehguy fehguy modified the milestone: v2.1.3 Jan 6, 2016
@webron
Copy link
Contributor

webron commented Mar 20, 2017

Would suggest to check out 3.0 and see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants