-
Notifications
You must be signed in to change notification settings - Fork 42
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
route model binding (Variable name cannot be longer than 32 characters in route pattern) #275
Comments
Can you show the |
Sure, here it is (only the routes related to this problem):
The index is action is working correctly. |
I think the Do you also have the schema? |
Ok, nevermind. I found the problem. In our schema we had a double /**
* Get the resource fields.
*/
public function fields(): array
{
return [
ID::make()->uuid(),
Str::make('name')->sortable(),
Str::make('description')->sortable(),
ID::make('chain')->sortable(); // causing the trouble...
DateTime::make('created_at')->sortable()->readOnly(),
DateTime::make('updated_at')->sortable()->readOnly(),
];
} The fact that Thanks for trying to help out and sorry for the trouble. Maybe check if there are multiple |
Yeah, that makes sense. I had the feeling it had something to do with the |
@lindyhopchris Is this an option in some way?
|
So "checking something" has cost, that you incur every single time the schema is created in a request. Just to catch a mistake a developer has made... I'll take a look but will only do something if it doesn't add in any extra processing. |
Maybe you could do something with debug mode? Performance is less important when debugging locally why something doesn't work. |
I completely agree! For debugging purposes it would be handy if this could be catched but if that has a performance hit in production then please leave it out. Maybe add an extra note to the documentation about this. |
Hi,
Due to the naming of one of our resources the variable name became too long. (more then 32 characters)
Simplest solution was to short the variable name by using the following:
Now when executing a request like:
Now I get a 404 Not found. The record that I am trying to fetch exists.
Usual without laravel-json-api I fix this by using:
But due to the fact that laravel-json-api uses its own substitute bindings this does not seem to work.
The question now is: What am I missing?
The text was updated successfully, but these errors were encountered: