Hi @jowo, I’m unable to reproduce the issue with your snippet. Could you please provide some more information?
- What’s the exact WooCommerce version you’re using?
- What’s the response that you get when you try to reach the endpoint?
- Do you have the Legacy REST API plugin installed?
Thread Starter
jowo
(@jowo)
Woocommerce 8.8.2
The response is a massive JSON response starting with:
{
"namespace": "wc/v3/products",
"routes": {
"/wc/v3/products": {
"namespace": "wc/v3",
"methods": [
"GET",
"GET",
"POST"
],
"endpoints": [
{
"methods": [
"GET"
],
"args": {
"namespace": {
"default": "wc/v3/products",
"required": false
},
"context": {
"default": "view",
"required": false
}
}
},
Declaring all routes and parameters. Looks like a JSON schema?
Yes the legacy plugin is installed and activated.
Hi @jowo
Thank for sharing further details.
For reference, these particular forums are meant for general support with the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.
Also, if you believe it is a bug, you can create a bug report in our GitHub repo here, where our developers, including @konamiman, can provide further insights.
I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.
Hi @jowo, I’m still unable to reproduce the issue. However, may I suggest you to register your endpoint like this instead:
register_rest_route('wc/v3', 'products/dec', array(...
If this still doesn’t work, could you please create an issue in the WooCommerce repository in GitHub? As Shameem pointed out that’s the better place to continue the discussion.
Great, thanks for letting me know. I’ll mark this thread as resolved then.