Skip to content

Conversation

@sima-zhu
Copy link
Contributor

No description provided.

* Deserializes a JSON object into a {@link Geometry}.
*/
final class GeometryDeserializer extends JsonDeserializer<Geometry> {
public final class GeometryDeserializer extends JsonDeserializer<Geometry> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for testing this, in the future when this work is merged into Azure Core it'll become package private again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think it doesn't hurt to public the serializer before we move back Azure Core.

exports com.azure.core.experimental.serializer;
exports com.azure.core.experimental.spatial;

opens com.azure.core.experimental.spatial to com.fasterxml.jackson.databind;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't believe this needs to open to databind as no databinding will happen with the types in spatial. They all should be using streaming deserialization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It indeed complaint about the PointGeometry did not open module to databind. Why spatial doesn't need to do reflection when serialize?

* @return A new instance of {@link JacksonSearchSerializer}.
*/
public JacksonJsonSerializer build() {
public JacksonSearchSerializer build() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the Azure Core implementation renamed? Just prototyping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Caused by IDE refactoring

/**
* Interface to be implemented by an azure-core plugin that wishes to provide a {@link SearchSerializer} implementation.
*/
public interface SearchSerializerProvider {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we would want to stay away from the Search serializer modules having a service provider interface, I feel instead they should wrap the Azure Core variant otherwise it'll be confusing to know what serialization implementation to use.

Another option would be the Search variants implement and provide the Core interface instead of their own.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have posted in team channel. Search needs to have type as parameter otherwise we are not able to do map serialization.
I am ok to move to azure-core-experiment module API if it provides the corresponding API

public abstract class SearchType<T> implements Comparable<SearchType<T>>{
private final Type _type;

public SearchType() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we add this class? If required we can change the interface in Core from taking a Class<T> to Type which would support both Class<T> and ParameterizedType which this seems to be attempting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By having SearchType, we can hide the ugly type reflection operation behind for user.

Map<String, Object> mapInstance = new HashMap<>;
Type type = ((ParameterizedType)mapInstance.getClass().getGenericSuperclass()).getActualTypeArguments()[0];

@sima-zhu sima-zhu requested a review from alzimmermsft July 16, 2020 17:20
@sima-zhu
Copy link
Contributor Author

/azp run java - search - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sima-zhu sima-zhu closed this Jul 17, 2020
@sima-zhu sima-zhu deleted the addbackexperimental branch July 17, 2020 16:51
@sima-zhu sima-zhu restored the addbackexperimental branch July 17, 2020 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants