hutaishi opened a new pull request, #3379:
URL: https://github.com/apache/incubator-shenyu/pull/3379

    Fixes #3374 
   Compatible with low version and output standard format json
   
   Make sure that:
   
   - [ ] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] You submit test cases (unit or integration tests) that back your 
changes.
   - [ ] Your local test passed `mvn clean install -Dmaven.javadoc.skip=true`.
   
   ## output standard format json
   ### before
   
![图片](https://user-images.githubusercontent.com/12478263/166848709-18136e59-08e5-4877-8c34-4769d201832e.png)
   ### after
   
![图片](https://user-images.githubusercontent.com/12478263/166848751-08d82553-242e-468d-81d7-2ccb44f2ea5b.png)
   
   ## defaultInstance field compatible
   ### before, grpc low version have no `defaultInstance` field.
   <img width="1408" alt="图片" 
src="https://user-images.githubusercontent.com/12478263/166848973-7432ea23-2fae-4ed5-8336-4f2697bb61ec.png";>
   ### after
   
   ```java 
                   if (requestMarshaller instanceof 
MethodDescriptor.PrototypeMarshaller) {
                       MethodDescriptor.PrototypeMarshaller<?> 
prototypeMarshaller = (PrototypeMarshaller<?>) requestMarshaller;
                       if 
(Objects.isNull(prototypeMarshaller.getMessagePrototype())) {
                           throw new ShenyuException(String.format("can not get 
defaultInstance Field of %s", requestMarshaller.getClass()));
                       }
                       grpcRequestParamClass = 
prototypeMarshaller.getMessagePrototype().getClass();
                   }
   ```
   ## serviceName field compatible
   ### before
   Lower versions do not have this field `serviceName` to throw exceptions
   ### after
   No exception is thrown if the field is empty, and the service name is set if 
the field is not empty.
   


-- 
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: [email protected]

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

Reply via email to