Skip to content

Conversation

@baywet
Copy link
Member

@baywet baywet commented Aug 4, 2021

No description provided.

dependabot bot and others added 27 commits June 22, 2021 08:02
Bumps [mockito-inline](https://github.com/mockito/mockito) from 3.11.1 to 3.11.2.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v3.11.1...v3.11.2)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [mockito-inline](https://github.com/mockito/mockito) from 3.11.1 to 3.11.2.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v3.11.1...v3.11.2)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…kito-mockito-inline-3.11.2

Bump mockito-inline from 3.11.1 to 3.11.2
…ito-mockito-inline-3.11.2

Bump mockito-inline from 3.11.1 to 3.11.2
Bumps [azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-java/releases)
- [Commits](Azure/azure-sdk-for-java@azure-core_1.17.0...azure-core_1.18.0)

---
updated-dependencies:
- dependency-name: com.azure:azure-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-java/releases)
- [Commits](Azure/azure-sdk-for-java@azure-core_1.17.0...azure-core_1.18.0)

---
updated-dependencies:
- dependency-name: com.azure:azure-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…re-azure-core-1.18.0

Bump azure-core from 1.17.0 to 1.18.0
…e-azure-core-1.18.0

Bump azure-core from 1.17.0 to 1.18.0
This change is related to #241 where version number in various places were bumped. It seems that the one in pom.xml should also be updated.
Bumps patch version also in pom.xml
…e adapters defined in GsonFactory are not overridden.
- DefaultSerializer
- CollectionResponseDeserializer
... as this is now taken care by ODataTypeParametrizedJsonBackedTypeAdapter.

Tests covering this change:
- com.microsoft.graph.serializer.DefaultSerializerTest.testDeserializationOfObjectWithODataTypeProperty
- com.microsoft.graph.serializer.ODataTypeParametrizedIJsonBackedTypedAdapterTest.testDeserializationOfNestedODataTypeAnnotatedObjects
@baywet baywet added this to the 2.0.8 milestone Aug 4, 2021
@baywet baywet requested a review from ddyett as a code owner August 4, 2021 14:58
@sonarqubecloud

This comment has been minimized.

nikithauc
nikithauc previously approved these changes Aug 5, 2021
Add support to set a setting to serialize null values
@MIchaelMainer
Copy link
Contributor

MIchaelMainer commented Aug 5, 2021

I want to block this release. I have a concern with the null serialization PR. I will add more info in a bit after I review the scenario. I believe there may be an unintended consequence that I'm investigating.

Copy link
Contributor

@MIchaelMainer MIchaelMainer left a comment

Choose a reason for hiding this comment

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

We may be fine, but I will feel better if we document this in the Java doc comments as a mitigation.

The side-effect of setting serializeNull on the defaultserializer is that PATCH requests sent with serializeNull == true result in unintended null values being sent for all properties not explicitly set on the PATCH object. Since serializeNull is not the default, we can be fine. We should consider adding a doc comment to the new overload so that it is clear that serializeNull should not be set on the defaultserializer when PATCH requests are sent. This could result in the unintended setting values to null, or the service API returning an exception with the unexpected attempt to set a value to null.

Another scenario to consider and that should be documented on the overload is the POST scenario. We POST an object with serializeNull == true will result in all unset properties being sent as null. Depending on the workload, we may see errors around attempts to set read-only properties. For example, if I perform the following with serializeNull:

User user = new User();
user.displayName = "Al Pacino";

final User result = graphClient
  .users()
  .buildRequest()
  .post(user);

All of the properties defined on the User class besides displayName will be serialized to null, including read-only properties. Depending on the service, it could respond with an exception.

@baywet
Copy link
Member Author

baywet commented Aug 6, 2021

Hey @MIchaelMainer,
Thanks for bringing this up. I put together PR #262 and which should hopefully address the concerns you raised.
As you mentionned, we should be fine because all the default instantiation relies on the overloads without the parameter which defaults to false.
For someone to get in trouble they'd have to:

  1. instantiate a new default serializer with the option set to true
  2. pass it along to the graph client builder

Have a look at the other PR and let me know if you think I missed anything.

…e-comments

release 2.0.8 comments correction
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

81.6% 81.6% Coverage
0.0% 0.0% Duplication

@MIchaelMainer
Copy link
Contributor

Thank you @baywet. BackingStore feature from Kiota will be so nice for addressing this scenario. Is there a way to selectively serialize null for a property?

@baywet
Copy link
Member Author

baywet commented Aug 6, 2021

@MIchaelMainer are you referring to this? microsoft/kiota#243 Yes the dirty tracking could in theory tell us which properties changed to null, so the serializer can add null property values to the payload, which would fix our PATCH issue.

@ramsessanchez it seems the work you're doing on the pipeline is blocking this PR here (the hooks are registered, but the pipelines definitions are missing from this branch). Do you want to wait for #257 to be finished and use those pipelines to deploy or do you want me to override this, merge as admin, and release with the old pipelines?

@ramsessanchez
Copy link
Contributor

ramsessanchez commented Aug 6, 2021

@ramsessanchez it seems the work you're doing on the pipeline is blocking this PR here (the hooks are registered, but the pipelines definitions are missing from this branch). Do you want to wait for #257 to be finished and use those pipelines to deploy or do you want me to override this, merge as admin, and release with the old pipelines?

@baywet I think it would be best to override. I've already gone ahead and paused the new pipelines and re-activated the sandbox ones that we've been using. I think that since this update has been requested for a bit now, it would be best to deploy the work that's been done until now and that we're currently satisfied with.

@ramsessanchez ramsessanchez reopened this Aug 6, 2021
@baywet baywet merged commit 4b07e04 into master Aug 6, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

81.6% 81.6% Coverage
0.0% 0.0% Duplication

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.

6 participants