opensearch-java icon indicating copy to clipboard operation
opensearch-java copied to clipboard

[PROPOSAL] ModelTestCase.mapper improvements

Open channel-dante opened this issue 2 years ago • 4 comments

What/Why

What are you proposing?

  • Modify the ModelTestCase model's mapper to use only one fixedly or both to use both fixedly. image

What problems are you trying to solve?

  • I don't think it's good code if a test passes or breaks randomly. It seems like a good idea to organize the reasons for using two mappers and improve it so that they are always used when both are needed.

What is the developer experience going to be?

  • No more cases of partially passing or failing tests

channel-dante avatar Dec 18 '23 03:12 channel-dante

100% thanks!

dblock avatar Dec 18 '23 15:12 dblock

@dblock Do you think that both mapper should support here? I think I can work on it once the decision is made.

channel-dante avatar Dec 19 '23 01:12 channel-dante

Hi @channel-dante and @dblock , we are adding a default Mapper in JsonUtils in this PR , please follow this comment to know the context, I think we can use that , rather than hardcoding one of them, the idea is to take the provider from the classpath instead of hardcoding one of the jakarta or Jackson

Caution : the methods in the mapper are overridden to provide support for the classes which implement JsonpSerializable

Jai2305 avatar Jul 07 '24 16:07 Jai2305

I am not sure what the implications of either are, let's look at the code! Thank you.

dblock avatar Jul 08 '24 14:07 dblock