Rails Grape API 'id is invalid' in request that requires no id
Denis YakovenkoI have a Grape API protected by Doorkeeper and I have a bunch of methods which work perfectly. However, there's one method that behaves weirdly. It is a GET request that requires no parameters and running it throws the following error:
Grape::Exceptions::ValidationErrors at /v1/discount_cards/all.json
Spotify API: INVALIDAPPID. Spotify Unity SDK. Hot Network Questions Is it dangerous to pass documents from an old infected laptop to a new one? Normally, Android libraries can use BuildConfig.DEBUG to determine if the app is in debug mode. However, due to a bug in Gradle, Android libraries are always built with DEBUG set to false.
id is invalid
My method looks like this:
Create A Client Id Spotify
The logs say that the error happens at line 17 of the logger.rb file, which looks like this:
Change Spotify Id
My main base.rb class looks like this:
I really cannot understand what id it is talking about, and, moreover, all the other api methods work absolutely fine (post, get, put, delete).
Could you help me with resolving that issue?
daxSpotify Invalid App_id
I had this issue recently too, and it turned out to be an issue of code order for me. I found the answer here.
Grape evaluates routes in order, so with two routes, /:id and /nearby_missions, it matches /:id first, making id=nearby_missions. Then it tries to coerce nearby_missions into an Integer which fails, and you get the missing id error.
You could 'fix' this by adding requirements: /d*/ to the first route (didn't test), but you're probably just better off ordering them in the order you want them to be evaluated, which is what you did.
There's not enough info in your question for me to be sure that this is also your problem, but it could well be!
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]