Skip to content
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

Fixes rm-cosmos regression #41748

Merged

Conversation

FabianMeiswinkel
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel commented Sep 6, 2024

Description

Since version 2.42.0 of azure-resourcemanager-cosmos the model POJP classes can't be serialized/derserialized with Jackson Object-Mapper anymore because they implement com.azure.json.JsonSerializable now - to allow to still use Jackson ObjectMapper directly a module com.azure.core.serializer.json.jackson.JacksonJsonProvider .getJsonSerializableDatabindModule() needs to be registered with the ObjectMapper.

This PR is adding this moduleto react to the breaking change in 2.42.0 of azure-resourcemanager-cosmos.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes. - internal only change -not released after picking up 2.42.0 yet - no need to capture in changelog
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes. - via existing /azp run java - cosmos - spark pipeline

@XiaofeiCao
Copy link
Contributor

I don't think we should be doing this.
After migration to azure-json, all Jackson annotations has been removed from class/fields. Hence, even with jackson appearing in module-info.java, serialization/deserialization could be problematic.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

com.azure.resourcemanager:azure-resourcemanager-cosmos

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel
Copy link
Member Author

I don't think we should be doing this. After migration to azure-json, all Jackson annotations has been removed from class/fields. Hence, even with jackson appearing in module-info.java, serialization/deserialization could be problematic.

That is true - and changing module-info did not help. So, using a different approach - but IMO it was really a terrible idea to make this breaking change and then release it as a minor version upgrade. azure-resourcemanager-cosmos should never have been moved to azure-core-json until moving to 3.* major version.

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@tvaron3 tvaron3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jeet1995 jeet1995 left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@FabianMeiswinkel FabianMeiswinkel merged commit 87354f6 into Azure:main Sep 6, 2024
39 checks passed
jairmyree pushed a commit to jairmyree/azure-sdk-for-java that referenced this pull request Sep 23, 2024
* Fixes rm-cosmos regression

* Iterating on rm-cosmos fix

* Update pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cosmos Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants