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

after specified API's serializers using format,the api.type requests are not found #914

Closed
TommyLike opened this issue Feb 5, 2015 · 5 comments

Comments

@TommyLike
Copy link

if i specified the API's serializers using format:

format :json

the api will return 404 not found when called using api.type,such as:

/task/testcase.json

I found this issue in version 0.10.1 and it's ok in previous version

@dblock
Copy link
Member

dblock commented Feb 5, 2015

By previous version you mean 0.9.0, right?

This was introduced deliberately in #809. We've discussed undoing that, I would still merge a PR.

@chaixl
Copy link

chaixl commented Mar 13, 2015

I also meet this problem after upgrading Grape, #809 is a break change and big problem for me.

Before upgrading, I specified the API format:

format :json

I can access API by api and api.format_type
e.g.

/account/login

or

/account/login.json

After upgrading, /account/login.json will return 404 not found. If remove "format :json", only /account/login.json can be used.
access /account/login directly will return

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<error>
<message>cannot convert String to xml</message>
</error>

But, out client use both /account/login and /account/login.json to access our API before.

@dblock
Copy link
Member

dblock commented Mar 13, 2015

You should be able to restore the old behavior by ensuring you have more than one format "supported", so after format :json add another content-type via content_type :foo, 'foo/bar'. Let us know if that works. I am still looking for a PR for this.

@dblock
Copy link
Member

dblock commented Mar 13, 2015

The culprit is here.

@dblock
Copy link
Member

dblock commented Apr 27, 2015

This has been reverted via #1001, please test.

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

3 participants