-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
schema for "/__experimental/menu-items" errors #34628
Comments
Hello @MohammedFaragallah I am developer of this endpoint. Let me explain these schema issues. gutenberg/lib/class-wp-rest-menu-items-controller.php Lines 1067 to 1070 in dd5fd6b
This is not a mistake. A menu item can not be assigned to multiple menus. So I highjacked the schema, so that you only assign it to one endpoint. gutenberg/lib/class-wp-rest-menu-items-controller.php Lines 1046 to 1051 in dd5fd6b
I will look into this |
@spacedmonkey thank you for your fast response
maybe add if ( 'nav_menu' === $taxonomy->name ) {
$schema['properties'][ $base ]['maxItems'] = 1;
} |
I don't like this idea, personally. Thoughts @TimothyBJacobs ? |
@spacedmonkey just a question does the schema represent the response? I'm asking because I'm generating typescript definitions from it to make the response typesafe it's working fine even with third-party plugins |
@MohammedFaragallah I have pushed a couple of fixes. The schema should match up now. Can you checkout trunk and see if fixes your issues. |
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks. |
I'm not sure any if these cases are intentional but,
gutenberg/lib/class-wp-rest-menu-items-controller.php
Lines 1067 to 1070 in dd5fd6b
this endpoint return array of numbers for
menus
not a numbergutenberg/lib/class-wp-rest-menu-items-controller.php
Lines 1046 to 1051 in dd5fd6b
also
_invalid
is missing not null or any falsy valueThe text was updated successfully, but these errors were encountered: