Open yingmanji opened 9 months ago
Is this a bug in the apisix dashboard or a configuration problem on my part?
When I modify the https://github.com/apache/apisix-dashboard/blame/v3.0.1/api/conf/schema.json and main.route.properties.script type is object, the error disappears.Can anyone tell me why?
"script": { "maxLength": 102400, "minLength": 10, "type": "object" }
Issue description
When using the apisix-dashboard plug-in orchestration mode to create routes, clicking the offline/publish button will report an error.:schema validate failed: script: Invalid type. Expected: string, given: object
apisix version:3.8.0 apisix dashboard version:3.0.1
I can see the following error in the apisix dashboard log: ERROR store/validate.go:251 schema validate failed:s: {"allOf":[{"oneOf":[{"required":["uri"]} .... ERROR store/store.go:224 data validate failed: schema validate failed: script: Invalid type. Expected: string, given: object, &{{500595392396657348 1707907705 1707920088} /test [] demo3 0 [GET POST PUT DELETE PATCH HEAD OPTIONS CONNECT TRACE PURGE] simple-java-app.example.com [] [][] map[chart:map[cells:[map[attrs:map[line:map[stroke:#5F95FF strokeWidth:1 targetMarker:map[name:classic size:8]]] id:884af56b-1f26-4f85-8e9a-2ca1570095aa router:map[name:manhattan] shape:edge source:map[cell:dcb03afe-26ec-40d7-aee3-12bba6b2a971 port:5f8ab45a-0929-4cd9-a26d-5ec3cb6eb068] target:map[cell:79d9c338-e182-44c9-883c-4e8c60b26b82 port:7b3d789b-bd5d-4c9b-bd1c-a7a568afff8d] zIndex:0] map[attrs:map[line:map[stroke:#5F95FF strokeWidth:1 targetMarker:map[name:classic size:8]]] id:64be95b4-ceab-414f-b65d-b991094e9cf2 router:map[name:manhattan] shape:edge source:map[cell:79d9c338-e182-44c9-883c-4e8c60b26b82 port:6d5dd30d-d2ca-4b4e-b4f2-b31a7178609f] target:map[cell:91e46b76-93d8-49fe-85a0-bcd1087ec8d4 port:9baf1647-4669-453f-bb60-50d2b26f463c] zIndex:0] map[attrs:map[line:map[stroke:#5F95FF strokeWidth:1 targetMarker:map[name:classic size:8]]] id:afe158d5-8948-42aa-b7cb-8c78095579f0 router:map[name:manhattan] shape:edge source:map[cell:91e46b76-93d8-49fe-85a0-bcd1087ec8d4 port:cc5d4881-f6b6-4a4d-92b2-8a6977335455] target:map[cell:02cfd4f8-3b92-446a-9737-f6f55cb16817 port:a17e3be5-c179-48d1-84d3-3827a76ea109] zIndex:0] map[attrs:map[body:map[rx:24 ry:24] text:map[textWrap:map[text:开始]]] id:dcb03afe-26ec-40d7-aee3-12bba6b2a971 ports:map[groups:map[bottom:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:bottom] left:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:left] right:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:right] top:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:top]] items:[map[group:bottom id:5f8ab45a-0929-4cd9-a26d-5ec3cb6eb068]]] position:map[x:420 y:110] shape:flow-chart-start-rect size:map[height:42 width:80] zIndex:1] map[attrs:map[text:map[text:key-auth] title:map[text:key-auth]] data:map[disable:false header:apikey] id:79d9c338-e182-44c9-883c-4e8c60b26b82 ports:map[groups:map[bottom:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:bottom] top:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:top]] items:[map[group:top id:7b3d789b-bd5d-4c9b-bd1c-a7a568afff8d] map[group:bottom id:6d5dd30d-d2ca-4b4e-b4f2-b31a7178609f]]] position:map[x:360 y:220] shape:flow-chart-plugin-rect size:map[height:60 width:200] zIndex:2] map[angle:45 attrs:map[text:map[textWrap:map[text:条件判断] transform:rotate(-45deg)]] data:code==401 id:91e46b76-93d8-49fe-85a0-bcd1087ec8d4 ports:map[groups:map[bottom:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:map[args:map[dx:26] name:bottom]] left:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:map[args:map[dy:26] name:left]] right:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:map[args:map[dy:-26] name:right]] top:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:map[args:map[dx:-26] name:top]]] items:[map[group:top id:9baf1647-4669-453f-bb60-50d2b26f463c] map[group:right id:615694ab-40bf-4a51-aa86-548e0e2a2bdf] map[group:bottom id:cc5d4881-f6b6-4a4d-92b2-8a6977335455]]] position:map[x:431 y:328] shape:flow-chart-condition-rect size:map[height:58 width:58] zIndex:3] map[attrs:map[text:map[text:uri-blocker] title:map[text:uri-blocker]] data:map[block_rules:[test] disable:false rejected_code:403 rejected_msg:this is a simple blocker test] id:02cfd4f8-3b92-446a-9737-f6f55cb16817 ports:map[groups:map[bottom:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:bottom] top:map[attrs:map[circle:map[fill:#fff magnet:true r:3 stroke:#5F95FF strokeWidth:1 style:map[visibility:hidden]]] position:top]] items:[map[group:top id:a17e3be5-c179-48d1-84d3-3827a76ea109] map[group:bottom id:66b2de8d-13ee-4baa-98ee-3a49fff8ec86]]] position:map[x:390 y:450] shape:flow-chart-plugin-rect size:map[height:60 width:200] zIndex:4]]] conf:map[02cfd4f8-3b92-446a-9737-f6f55cb16817:map[conf:map[block_rules:[test] disable:false rejected_code:403 rejected_msg:this is a simple blocker test] name:uri-blocker] 79d9c338-e182-44c9-883c-4e8c60b26b82:map[conf:map[disable:false header:apikey] name:key-auth]] rule:map[79d9c338-e182-44c9-883c-4e8c60b26b82:[[code==401 02cfd4f8-3b92-446a-9737-f6f55cb16817]] root:79d9c338-e182-44c9-883c-4e8c60b26b82]] 500595392396657348 map[] 500595312788767428 map[API_VERSION:3.0] false 0}
Expected behavior
When using the route created by the apisix-dashboard plug-in orchestration mode, no error will be reported when clicking the Offline/Publish button
How to Reproduce
I can change the status normally through apisix admin api curl http://127.0.0.1:9180/apisix/admin/routes/499429907537855172 \ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d ' { "status": 0 }'
Screenshots
No response
Environment
Additional context
No response