You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "lilijreey (via GitHub)" <gi...@apache.org> on 2026/01/26 05:19:22 UTC

[I] docs: use subpath patch method to delete route's hosts, but return 'validation failed' [apisix]

lilijreey opened a new issue, #12939:
URL: https://github.com/apache/apisix/issues/12939

   ### Current State
   
   SubPath PATCH set hosts to null, but response error, Why? need help.
   
   
   
   ### Desired State
   
   curl --request PATCH \
     --url http://10.1.33.116:9180/apisix/admin/routes/3d8eb989/hosts \
     --header 'Accept: */*' \
     --header 'Accept-Encoding: gzip, deflate, br' \
     --header 'Connection: keep-alive' \
     --header 'Content-Type: application/json' \
     --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
     --header 'X-API-KEY:xxxx' \
     --data null
   
   response: 
   "error_msg": "invalid configuration: property \"hosts\" validation failed: wrong type: expected array, got userdata"
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] docs: use subpath patch method to delete route's hosts, but return 'validation failed' [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #12939:
URL: https://github.com/apache/apisix/issues/12939#issuecomment-3798082211

   This is a design limitation, not a bug. Only standard PATCH supports deleting attributes using null. The purpose of SubPath PATCH is to “fully update the data of that attribute,” not to delete the attribute. To remove the hosts attribute from a route, you should use standard PATCH:
   
   ```
   curl --request PATCH \
     --url http://127.0.0.1:9180/apisix/admin/routes/3d8eb989 \
     --header 'X-API-KEY: xxx' \
     --header 'Content-Type: application/json' \
     --data '{"hosts": null}'
   ```
   
   Additionally, I noticed inconsistencies in the descriptions of the patch method at these two locations, which appear to require updating the English documentation. cc @kayx23 
   https://apisix.apache.org/zh/docs/apisix/admin-api/#route-request-methods
   https://apisix.apache.org/docs/apisix/admin-api/#request-methods


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] docs: use subpath patch method to delete route's hosts, but return 'validation failed' [apisix]

Posted by "lilijreey (via GitHub)" <gi...@apache.org>.
lilijreey closed issue #12939: docs: use subpath patch method to delete route's hosts, but return 'validation failed'
URL: https://github.com/apache/apisix/issues/12939


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] docs: use subpath patch method to delete route's hosts, but return 'validation failed' [apisix]

Posted by "lilijreey (via GitHub)" <gi...@apache.org>.
lilijreey commented on issue #12939:
URL: https://github.com/apache/apisix/issues/12939#issuecomment-3808272602

   thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org