juzhiyuan commented on a change in pull request #1081:
URL: https://github.com/apache/apisix-dashboard/pull/1081#discussion_r546310183



##########
File path: api/filter/schema.go
##########
@@ -136,6 +144,25 @@ func handleSpecialField(resource string, reqBody []byte) 
([]byte, error) {
        return reqBody, nil
 }
 
+func handleDefaultValue(resource string, reqBody []byte) ([]byte, error) {
+       // go jsonschema lib doesn't support setting default values, so we need 
to set for some fields necessary
+       if resource == "routes" {
+               var route map[string]interface{}
+               err := json.Unmarshal(reqBody, &route)
+               if err != nil {
+                       return reqBody, fmt.Errorf("read request body failed: 
%s", err)
+               }
+               if _, ok := route["status"]; !ok {

Review comment:
       Got it, 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to