-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCB-333 Update to support the date time with JSR-310 #732
Conversation
String localDate = "\"2018-05-28\""; | ||
String localDateTime = "\"2018-05-28T11:00:00\""; | ||
|
||
JsonUtils.OBJ_MAPPER.readValue(period, Period.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to verify the value of object here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it makes sense.
1.RestObjectMapper is for RESTful codec, it's better to add UT for it. |
@wujimin I'm not very sure what the UT and the IT means ? |
Unit Test |
Integrations tests mean we need to add an end-to-end use case in a RPC consumer & provider. You can add examples in demos/SpringMVCclient and SpringMVCserver. |
You can add provider code here : https://github.com/apache/incubator-servicecomb-java-chassis/blob/master/demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java and consumer code here: and run this two projects locally to see if swagger if correctly generated. |
So I also need to take a look at the swagger generator codes to make sure it can handle the localDate with the JSR310 ? |
Yes, I think so. Or users how to use this feature you provided? I can't figure out what is changed after this PR to developers using java-chassis. Directly using internal APIs in JsonUtils or RestObjectMapper is rarely and users can use the original API, this is not our concern I think. |
I think I have some pojo codes for this localDate Type testing. Now I give it a try. |
@imlidian Please updated the verification that you did. |
The Error and my test case implement way as follows. Did I miss something about adding one test case? Error: Exception in thread "main" java.lang.IllegalStateException: Consumer method org.apache.servicecomb.demo.springmvc.client.CodeFirstSpringmvcIntf:testObject not exist in contract, microserviceName=springmvc, schemaId=codeFirst; new producer not running or not deployed. Interface Side: Object testObject(Object input); LocalDate testLocalDate(LocalDate input); //LocalDateTime testLocalDateTime(LocalDateTime input); } Client Side:
} |
You can check your provider logs for detail messages. It usually maybe you add some new methods and microservice version not changed and the consumer cannot see the newly added method from service center. See here for more details: https://huaweicse.github.io/servicecomb-java-chassis-doc/zh_CN/question-and-answer/interface-compatibility.html |
We have opened an API to let users to customize RestObjectMapper #874. If users want to use the feature provided by this PR, they can write their own RestObjectMapper. |
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles
, where you replaceSCB-XXX
with the appropriate JIRA issue.mvn clean install
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.