You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/07 13:40:38 UTC

[GitHub] [apisix] tokers commented on issue #4976: schema validate failed: upstream: Additional property scheme is not allowed?

tokers commented on issue #4976:
URL: https://github.com/apache/apisix/issues/4976#issuecomment-914315766


   > > I can't reproduce it with:
   > > ```
   > > curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d @$HOME/r/ap_up.json -i
   > > HTTP/1.1 201 Created
   > > Server: openresty
   > > Date: Fri, 03 Sep 2021 03:25:58 GMT
   > > Content-Type: application/json
   > > Transfer-Encoding: chunked
   > > Connection: keep-alive
   > > Access-Control-Allow-Origin: *
   > > Access-Control-Allow-Credentials: true
   > > Access-Control-Expose-Headers: *
   > > Access-Control-Max-Age: 3600
   > > 
   > > {"node":{"value":{"host":"test.domain.com","id":"1","vars":[["http_User-Agent","~*","iPhone"]],"name":"km-feature","update_time":1630639558,"labels":{},"status":1,"uri":"\/*","create_time":1630639558,"methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"upstream":{"timeout":{"connect":6,"send":6,"read":6},"pass_host":"pass","hash_on":"vars","scheme":"http","nodes":[{"weight":1,"host":"test.test.svc.cluster.local","priority":0,"port":80}],"type":"roundrobin"},"priority":1},"key":"\/apisix\/routes\/1"},"action":"set"}
   > > ```
   > 
   > here is curl content, method is **PUT**, not **Created**
   > 
   > ```
   > curl 'http://127.0.0.1:19000/apisix/admin/routes/359384509122085790' \
   >   -X 'PUT' \
   >   -H 'Connection: keep-alive' \
   >   -H 'Pragma: no-cache' \
   >   -H 'Cache-Control: no-cache' \
   >   -H 'Accept: application/json' \
   >   -H 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzEwNDU2ODUsImlhdCI6MTYzMTAwOTY4NSwic3ViIjoiYWRtaW4ifQ.tFFSCdzieRsf9B_BRQEfVQSk0HjlgVAWprrFpiEaMys' \
   >   -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36' \
   >   -H 'Content-Type: application/json;charset=UTF-8' \
   >   -H 'Origin: http://10.99.27.177:19000' \
   >   -H 'Referer: http://10.99.27.177:19000/routes/359384509122085790/edit' \
   >   -H 'Accept-Language: zh-CN,zh;q=0.9' \
   >   --data-raw $'{"methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"priority":1,"name":"nginx","status":1,"labels":{},"vars":[["http_User-Agent","~*","iPhone"]],"uri":"/*","host":"test.domain.com","upstream":{"type":"roundrobin","nodes":[{"host":"nginx","port":80,"weight":1}],"pass_host":"pass","scheme":"http","timeout":{"connect":6,"send":6,"read":6}}}' \
   >   --compressed \
   >   --insecure
   > ```
   > 
   > And when I remove field **scheme**, it update success
   
   The code snippet shown by @spacewander really has the `PUT` method. The `201 Created` is just the response status line.


-- 
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