Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/kiota-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.12
Choose a base ref
...
head repository: microsoft/kiota-java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.13
Choose a head ref
  • 4 commits
  • 5 files changed
  • 4 contributors

Commits on May 23, 2024

  1. Update needs-author-feedback label to replacement

    fey101 committed May 23, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    baywet Vincent Biret
    Copy the full SHA
    c52a793 View commit details
  2. Merge pull request #1326 from microsoft/update-label-needs-author-fee…

    …dback-to-current-label-in-use
    
    Update needs-author-feedback label to replacement
    fey101 authored May 23, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    baywet Vincent Biret
    Copy the full SHA
    98e0b9e View commit details

Commits on May 31, 2024

  1. Fixes serialization of parsables in additionalData

    Andrew Omondi committed May 31, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    019e0d5 View commit details

Commits on Jun 3, 2024

  1. Merge pull request #1327 from microsoft/andrueastman/fixSerialization

    Fixes serialization of parsables in additionalData
    andrueastman authored Jun 3, 2024
    Copy the full SHA
    b7be3e3 View commit details
8 changes: 4 additions & 4 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ configuration:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
- hasLabel:
label: 'Status: No Recent Activity'
- noActivitySince:
@@ -31,7 +31,7 @@ configuration:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
- noActivitySince:
days: 4
- isNotLabeledWith:
@@ -64,13 +64,13 @@ configuration:
- isActivitySender:
issueAuthor: True
- hasLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
- isOpen
then:
- addLabel:
label: 'Needs: Attention :wave:'
- removeLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
description:
- if:
- payloadType: Issues
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.13] - 2024-05-31

### Changed

- Fixed a bug where Parsable instances in the `additionalData` would lead to failed serialization with an `IllegalStateException`. [microsoftgraph/msgraph-sdk-java#1969](https://github.com/microsoftgraph/msgraph-sdk-java/issues/1969)

## [1.1.12] - 2024-05-21

### Changed
Original file line number Diff line number Diff line change
@@ -489,6 +489,7 @@ else if (valueClass.equals(PeriodAndDuration.class))
this.writePeriodAndDurationValue(key, (PeriodAndDuration) value);
else if (value instanceof Iterable<?>)
this.writeCollectionOfPrimitiveValues(key, (Iterable<?>) value);
else if (value instanceof Parsable) this.writeObjectValue(key, (Parsable) value);
else if (!valueClass.isPrimitive()) this.writeNonParsableObject(key, value);
else throw new RuntimeException("unknown type to serialize " + valueClass.getName());
}
Original file line number Diff line number Diff line change
@@ -3,16 +3,44 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.microsoft.kiota.Compatibility;
import com.microsoft.kiota.serialization.mocks.MyEnum;
import com.microsoft.kiota.serialization.mocks.TestEntity;
import com.microsoft.kiota.serialization.mocks.UntypedTestEntity;

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

class JsonSerializationWriterTests {

@Test
void writesSampleObjectValueWithParsableInAddtionalData() throws IOException {
var testEntity = new TestEntity();
testEntity.setId("test_id");
var phones = new ArrayList<String>();
phones.add("123456789");
testEntity.setPhones(phones);
var managerAdditionalData = new TestEntity();
managerAdditionalData.setId("manager_id");
managerAdditionalData.setMyEnum(MyEnum.MY_VALUE1);

testEntity
.getAdditionalData()
.put("manager", managerAdditionalData); // place a parsable in the addtionaldata

var jsonSerializer = new JsonSerializationWriter();
jsonSerializer.writeObjectValue("", testEntity);
var contentStream = jsonSerializer.getSerializedContent();
var serializedJsonString = new String(Compatibility.readAllBytes(contentStream), "UTF-8");
// Assert
var expectedString =
"{\"id\":\"test_id\",\"phones\":[\"123456789\"],\"manager\":{\"id\":\"manager_id\",\"myEnum\":\"VALUE1\"}}";
assertEquals(expectedString, serializedJsonString);
}

@Test
void writesSampleObjectValueWithUntypedProperties() throws IOException {
// Arrange
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ org.gradle.caching=true
mavenGroupId = com.microsoft.kiota
mavenMajorVersion = 1
mavenMinorVersion = 1
mavenPatchVersion = 12
mavenPatchVersion = 13
mavenArtifactSuffix =

#These values are used to run functional tests