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: v0.7.8
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: v0.8.0
Choose a head ref

Commits on Oct 16, 2023

  1. Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/abstractions

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 16, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    86c8ab7 View commit details
  2. Merge pull request #747 from microsoft/dependabot/gradle/components/a…

    …bstractions/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/abstractions
    github-actions[bot] authored Oct 16, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1251b64 View commit details
  3. Bump com.github.spotbugs in /components/authentication/azure

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 16, 2023

    Verified

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

Commits on Oct 17, 2023

  1. Merge pull request #744 from microsoft/dependabot/gradle/components/a…

    …uthentication/azure/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/authentication/azure
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2d7deb7 View commit details
  2. Bump com.github.spotbugs in /components/serialization/multipart

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    51ee536 View commit details
  3. Bump com.github.spotbugs in /components/serialization/json

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    565fae2 View commit details
  4. Merge pull request #749 from microsoft/dependabot/gradle/components/s…

    …erialization/json/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/serialization/json
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    14fd23b View commit details
  5. Merge pull request #746 from microsoft/dependabot/gradle/components/s…

    …erialization/multipart/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/serialization/multipart
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7fb15f6 View commit details
  6. Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/http/okHttp

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4aa3906 View commit details
  7. Bump com.github.spotbugs in /components/serialization/text

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d466bb5 View commit details
  8. Merge pull request #750 from microsoft/dependabot/gradle/components/s…

    …erialization/text/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/serialization/text
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f486be2 View commit details
  9. Merge pull request #745 from microsoft/dependabot/gradle/components/h…

    …ttp/okHttp/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/http/okHttp
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    da6c405 View commit details
  10. Bump com.github.spotbugs in /components/serialization/form

    Bumps com.github.spotbugs from 5.1.5 to 5.2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4e933fe View commit details
  11. Merge pull request #748 from microsoft/dependabot/gradle/components/s…

    …erialization/form/com.github.spotbugs-5.2.0
    
    Bump com.github.spotbugs from 5.1.5 to 5.2.0 in /components/serialization/form
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    35ff040 View commit details
  12. Bump com.squareup.okhttp3:okhttp in /components/http/okHttp

    Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0.
    - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
    - [Commits](square/okhttp@parent-4.11.0...parent-4.12.0)
    
    ---
    updated-dependencies:
    - dependency-name: com.squareup.okhttp3:okhttp
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ffcad65 View commit details
  13. Bump com.squareup.okhttp3:okhttp in /components/http/okHttp/android

    Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0.
    - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
    - [Commits](square/okhttp@parent-4.11.0...parent-4.12.0)
    
    ---
    updated-dependencies:
    - dependency-name: com.squareup.okhttp3:okhttp
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    96d7cb7 View commit details
  14. Bump io.github.std-uritemplate:std-uritemplate

    Bumps [io.github.std-uritemplate:std-uritemplate](https://github.com/std-uritemplate/std-uritemplate) from 0.0.43 to 0.0.44.
    - [Commits](std-uritemplate/std-uritemplate@0.0.43...0.0.44)
    
    ---
    updated-dependencies:
    - dependency-name: io.github.std-uritemplate:std-uritemplate
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    59f0f26 View commit details
  15. Bump io.github.std-uritemplate:std-uritemplate

    Bumps [io.github.std-uritemplate:std-uritemplate](https://github.com/std-uritemplate/std-uritemplate) from 0.0.43 to 0.0.44.
    - [Commits](std-uritemplate/std-uritemplate@0.0.43...0.0.44)
    
    ---
    updated-dependencies:
    - dependency-name: io.github.std-uritemplate:std-uritemplate
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    79c88ee View commit details
  16. Merge pull request #754 from microsoft/dependabot/gradle/components/a…

    …bstractions/android/io.github.std-uritemplate-std-uritemplate-0.0.44
    
    Bump io.github.std-uritemplate:std-uritemplate from 0.0.43 to 0.0.44 in /components/abstractions/android
    github-actions[bot] authored Oct 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    77272e8 View commit details
  17. Merge pull request #752 from microsoft/dependabot/gradle/components/h…

    …ttp/okHttp/android/com.squareup.okhttp3-okhttp-4.12.0
    
    Bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 in /components/http/okHttp/android
    github-actions[bot] authored Oct 17, 2023

    Verified

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

Commits on Oct 18, 2023

  1. Merge pull request #751 from microsoft/dependabot/gradle/components/h…

    …ttp/okHttp/com.squareup.okhttp3-okhttp-4.12.0
    
    Bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 in /components/http/okHttp
    github-actions[bot] authored Oct 18, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b0b5ddf View commit details
  2. Merge pull request #753 from microsoft/dependabot/gradle/components/a…

    …bstractions/io.github.std-uritemplate-std-uritemplate-0.0.44
    
    Bump io.github.std-uritemplate:std-uritemplate from 0.0.43 to 0.0.44 in /components/abstractions
    github-actions[bot] authored Oct 18, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e7f4d53 View commit details
  3. Bump com.azure:azure-core in /components/authentication/azure

    Bumps [com.azure:azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.44.0 to 1.44.1.
    - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases)
    - [Commits](Azure/azure-sdk-for-java@azure-core_1.44.0...azure-core_1.44.1)
    
    ---
    updated-dependencies:
    - dependency-name: com.azure:azure-core
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 18, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    02a330f View commit details
  4. Bump com.azure:azure-core in /components/authentication/azure/android

    Bumps [com.azure:azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.44.0 to 1.44.1.
    - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases)
    - [Commits](Azure/azure-sdk-for-java@azure-core_1.44.0...azure-core_1.44.1)
    
    ---
    updated-dependencies:
    - dependency-name: com.azure:azure-core
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 18, 2023

    Verified

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

Commits on Oct 19, 2023

  1. Merge pull request #756 from microsoft/dependabot/gradle/components/a…

    …uthentication/azure/android/com.azure-azure-core-1.44.1
    
    Bump com.azure:azure-core from 1.44.0 to 1.44.1 in /components/authentication/azure/android
    github-actions[bot] authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    72ffc77 View commit details
  2. Merge pull request #755 from microsoft/dependabot/gradle/components/a…

    …uthentication/azure/com.azure-azure-core-1.44.1
    
    Bump com.azure:azure-core from 1.44.0 to 1.44.1 in /components/authentication/azure
    github-actions[bot] authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    04987d1 View commit details
  3. Bump io.github.std-uritemplate:std-uritemplate

    Bumps [io.github.std-uritemplate:std-uritemplate](https://github.com/std-uritemplate/std-uritemplate) from 0.0.44 to 0.0.46.
    - [Commits](std-uritemplate/std-uritemplate@0.0.44...0.0.46)
    
    ---
    updated-dependencies:
    - dependency-name: io.github.std-uritemplate:std-uritemplate
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d8024fe View commit details
  4. Bump com.github.spotbugs in /components/serialization/json

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b9e1f2c View commit details
  5. Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/http/okHttp

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eaffae1 View commit details
  6. Bump io.github.std-uritemplate:std-uritemplate

    Bumps [io.github.std-uritemplate:std-uritemplate](https://github.com/std-uritemplate/std-uritemplate) from 0.0.44 to 0.0.46.
    - [Commits](std-uritemplate/std-uritemplate@0.0.44...0.0.46)
    
    ---
    updated-dependencies:
    - dependency-name: io.github.std-uritemplate:std-uritemplate
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2cd5964 View commit details
  7. Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/abstractions

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 19, 2023

    Verified

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

Commits on Oct 20, 2023

  1. Merge pull request #757 from microsoft/dependabot/gradle/components/a…

    …bstractions/android/io.github.std-uritemplate-std-uritemplate-0.0.46
    
    Bump io.github.std-uritemplate:std-uritemplate from 0.0.44 to 0.0.46 in /components/abstractions/android
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8bfe6d9 View commit details
  2. Merge pull request #758 from microsoft/dependabot/gradle/components/s…

    …erialization/json/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/serialization/json
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9e278e7 View commit details
  3. Merge pull request #759 from microsoft/dependabot/gradle/components/h…

    …ttp/okHttp/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/http/okHttp
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e69b79b View commit details
  4. Merge pull request #761 from microsoft/dependabot/gradle/components/a…

    …bstractions/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/abstractions
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1f724b3 View commit details
  5. Merge pull request #760 from microsoft/dependabot/gradle/components/a…

    …bstractions/io.github.std-uritemplate-std-uritemplate-0.0.46
    
    Bump io.github.std-uritemplate:std-uritemplate from 0.0.44 to 0.0.46 in /components/abstractions
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e16f10d View commit details
  6. Bump com.github.spotbugs in /components/serialization/text

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    db5f26e View commit details
  7. Bump com.github.spotbugs in /components/serialization/form

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    37272e7 View commit details
  8. Merge pull request #764 from microsoft/dependabot/gradle/components/s…

    …erialization/text/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/serialization/text
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f5abf16 View commit details
  9. Merge pull request #763 from microsoft/dependabot/gradle/components/s…

    …erialization/form/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/serialization/form
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fc27b66 View commit details
  10. Bump com.github.spotbugs in /components/authentication/azure

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    62f9fdc View commit details
  11. Merge pull request #765 from microsoft/dependabot/gradle/components/a…

    …uthentication/azure/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/authentication/azure
    github-actions[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6a8af18 View commit details
  12. Bump com.github.spotbugs in /components/serialization/multipart

    Bumps com.github.spotbugs from 5.2.0 to 5.2.1.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e400c44 View commit details
  13. Merge pull request #762 from microsoft/dependabot/gradle/components/s…

    …erialization/multipart/com.github.spotbugs-5.2.1
    
    Bump com.github.spotbugs from 5.2.0 to 5.2.1 in /components/serialization/multipart
    github-actions[bot] authored Oct 20, 2023

    Verified

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

Commits on Oct 30, 2023

  1. Copy the full SHA
    febc42e View commit details
  2. spotbugs

    andreaTP committed Oct 30, 2023
    Copy the full SHA
    3eecc99 View commit details

Commits on Oct 31, 2023

  1. minor

    andreaTP committed Oct 31, 2023
    Copy the full SHA
    7b4d6c4 View commit details
  2. minor

    andreaTP committed Oct 31, 2023
    Copy the full SHA
    46fd0da View commit details
  3. Merge pull request #766 from andreaTP/basic-auth

    Add a Basic Access Authentication Provider
    baywet authored Oct 31, 2023

    Verified

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

    This commit was signed with the committer’s verified signature.
    baywet Vincent Biret
    Copy the full SHA
    bb63cca View commit details
Showing with 764 additions and 31 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −1 components/abstractions/build.gradle
  3. +1 −1 components/abstractions/gradle/dependencies.gradle
  4. +12 −0 components/abstractions/spotBugsExcludeFilter.xml
  5. +33 −0 components/abstractions/src/main/java/com/microsoft/kiota/Compatibility.java
  6. +3 −17 components/abstractions/src/main/java/com/microsoft/kiota/MultipartBody.java
  7. +43 −0 ...tractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java
  8. +151 −0 components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaJsonSerialization.java
  9. +226 −0 components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java
  10. +1 −1 ...tractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterFactoryRegistry.java
  11. +79 −0 ...ents/abstractions/src/test/java/com/microsoft/kiota/serialization/DeserializationHelpersTest.java
  12. +62 −0 ...onents/abstractions/src/test/java/com/microsoft/kiota/serialization/SerializationHelpersTest.java
  13. +134 −0 components/abstractions/src/test/java/com/microsoft/kiota/serialization/mocks/TestEntity.java
  14. +1 −1 components/authentication/azure/build.gradle
  15. +1 −1 components/authentication/azure/gradle/dependencies.gradle
  16. +1 −1 components/http/okHttp/build.gradle
  17. +1 −1 components/http/okHttp/gradle/dependencies.gradle
  18. +1 −1 ...http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UserAgentHandlerOption.java
  19. +1 −1 components/serialization/form/build.gradle
  20. +1 −1 components/serialization/json/build.gradle
  21. +1 −1 components/serialization/multipart/build.gradle
  22. +1 −1 components/serialization/text/build.gradle
  23. +2 −2 gradle.properties
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## [0.8.0] - 2023-10-31

### Added

- Added a default implementation of `BasicAccessAuthenticationProvider`
- Added helper methods to serialize kiota models. [microsoft/kiota#3406](https://github.com/microsoft/kiota/issues/3406)

## [0.7.8] - 2023-10-13

### Fixed
2 changes: 1 addition & 1 deletion components/abstractions/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

2 changes: 1 addition & 1 deletion components/abstractions/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:32.1.3-jre'
implementation 'org.javatuples:javatuples:1.2'
implementation 'io.github.std-uritemplate:std-uritemplate:0.0.43'
implementation 'io.github.std-uritemplate:std-uritemplate:0.0.46'
implementation 'io.opentelemetry:opentelemetry-api:1.31.0'
implementation 'io.opentelemetry:opentelemetry-context:1.31.0'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
12 changes: 12 additions & 0 deletions components/abstractions/spotBugsExcludeFilter.xml
Original file line number Diff line number Diff line change
@@ -35,4 +35,16 @@ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubu
<Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
<Class name="com.microsoft.kiota.authentication.ApiKeyAuthenticationProviderTest" />
</Match>
<Match>
<Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
<Class name="com.microsoft.kiota.serialization.DeserializationHelpersTest" />
</Match>
<Match>
<Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
<Class name="com.microsoft.kiota.serialization.SerializationHelpersTest" />
</Match>
<Match>
<Bug pattern="EI_EXPOSE_REP" />
<Class name="com.microsoft.kiota.serialization.mocks.TestEntity" />
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.microsoft.kiota;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

import jakarta.annotation.Nonnull;
/**
* Compatibility methods for android
*/
public class Compatibility {
private Compatibility() {
}
/**
* INTERNAL METHOD, DO NOT USE DIRECTLY
* Reads all bytes from the given input stream
* @param inputStream the input stream to read from
* @return the bytes read from the stream
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static byte[] readAllBytes(@Nonnull final InputStream inputStream) throws IOException {
// InputStream.readAllBytes() is only available to Android API level 33+
final int bufLen = 1024;
byte[] buf = new byte[bufLen];
int readLen;
try(final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
while ((readLen = inputStream.read(buf, 0, bufLen)) != -1)
outputStream.write(buf, 0, readLen);
return outputStream.toByteArray();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.microsoft.kiota;

import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -131,7 +128,7 @@ public void serialize(@Nonnull final SerializationWriter writer) {
try (final InputStream partContent = partWriter.getSerializedContent()) {
if (partContent.markSupported())
partContent.reset();
writer.writeByteArrayValue("", readAllBytes(partContent));
writer.writeByteArrayValue("", Compatibility.readAllBytes(partContent));
}
}
} else if (objectValue instanceof String) {
@@ -140,7 +137,7 @@ public void serialize(@Nonnull final SerializationWriter writer) {
final InputStream inputStream = (InputStream)objectValue;
if (inputStream.markSupported())
inputStream.reset();
writer.writeByteArrayValue("", readAllBytes(inputStream));
writer.writeByteArrayValue("", Compatibility.readAllBytes(inputStream));
} else if (objectValue instanceof byte[]) {
writer.writeByteArrayValue("", (byte[])objectValue);
} else {
@@ -153,16 +150,5 @@ public void serialize(@Nonnull final SerializationWriter writer) {
writer.writeStringValue("", "");
writer.writeStringValue("", "--" + boundary + "--");
}
@Nonnull
private byte[] readAllBytes(@Nonnull final InputStream inputStream) throws IOException {
// InputStream.readAllBytes() is only available to Android API level 33+
final int bufLen = 1024;
byte[] buf = new byte[bufLen];
int readLen;
try(final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
while ((readLen = inputStream.read(buf, 0, bufLen)) != -1)
outputStream.write(buf, 0, readLen);
return outputStream.toByteArray();
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.microsoft.kiota.authentication;

import com.microsoft.kiota.RequestInformation;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

/** Provides an implementation of the Basic Access Authentication scheme: https://en.wikipedia.org/wiki/Basic_access_authentication . */
public class BasicAccessAuthenticationProvider implements AuthenticationProvider {
private final static String AUTHORIZATION_HEADER_KEY = "Authorization";
private static final String BASIC = "Basic ";

private final String username;
private final String password;
private final String encoded;

/**
* Instantiates a new BasicAccessAuthenticationProvider.
* @param username the username to be used.
* @param password the password to be used.
*/
public BasicAccessAuthenticationProvider(@Nonnull final String username, @Nonnull final String password) {
Objects.requireNonNull(username);
Objects.requireNonNull(password);

this.username = username;
this.password = password;
encoded = Base64.getEncoder().encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8));
}

/** {@inheritDoc} */
@Override
@Nonnull
public CompletableFuture<Void> authenticateRequest(@Nonnull final RequestInformation request, @Nullable final Map<String, Object> additionalAuthenticationContext) {
request.headers.add(AUTHORIZATION_HEADER_KEY, BASIC + encoded);
return CompletableFuture.completedFuture(null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package com.microsoft.kiota.serialization;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import jakarta.annotation.Nonnull;

/**
* Helper methods for JSON serialization of kiota models
*/
public class KiotaJsonSerialization {
private static final String CONTENT_TYPE = "application/json";
private KiotaJsonSerialization() {}
/**
* Serializes the given value to a stream
* @param <T> the type of the value to serialize
* @param value the value to serialize
* @return the serialized value as a stream
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> InputStream serializeAsStream(@Nonnull final T value) throws IOException {
return KiotaSerialization.serializeAsStream(CONTENT_TYPE, value);
}
/**
* Serializes the given value to a string
* @param <T> the type of the value to serialize
* @param value the value to serialize
* @return the serialized value as a string
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> String serializeAsString(@Nonnull final T value) throws IOException {
return KiotaSerialization.serializeAsString(CONTENT_TYPE, value);
}
/**
* Serializes the given value to a stream
* @param <T> the type of the value to serialize
* @param values the values to serialize
* @return the serialized value as a stream
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> InputStream serializeAsStream(@Nonnull final Iterable<T> values) throws IOException {
return KiotaSerialization.serializeAsStream(CONTENT_TYPE, values);
}
/**
* Serializes the given value to a string
* @param <T> the type of the value to serialize
* @param values the values to serialize
* @return the serialized value as a string
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> String serializeAsString(@Nonnull final Iterable<T> values) throws IOException {
return KiotaSerialization.serializeAsString(CONTENT_TYPE, values);
}
/**
* Deserializes the given stream to a model object
* @param <T> the type of the value to deserialize
* @param stream the stream to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final InputStream stream, @Nonnull final ParsableFactory<T> parsableFactory) {
return KiotaSerialization.deserialize(CONTENT_TYPE, stream, parsableFactory);
}
/**
* Deserializes the given string to a model object
* @param <T> the type of the value to deserialize
* @param value the string to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final String value, @Nonnull final ParsableFactory<T> parsableFactory) throws IOException {
return KiotaSerialization.deserialize(CONTENT_TYPE, value, parsableFactory);
}
/**
* Deserializes the given string to a collection of model objects
* @param <T> the type of the value to deserialize
* @param value the string to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final String value, @Nonnull final ParsableFactory<T> parsableFactory) throws IOException {
return KiotaSerialization.deserializeCollection(CONTENT_TYPE, value, parsableFactory);
}
/**
* Deserializes the given stream to a collection of model objects
* @param <T> the type of the value to deserialize
* @param stream the stream to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final InputStream stream, @Nonnull final ParsableFactory<T> parsableFactory) {
return KiotaSerialization.deserializeCollection(CONTENT_TYPE, stream, parsableFactory);
}
/**
* Deserializes the given stream to a model object
* @param <T> the type of the value to deserialize
* @param stream the stream to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final InputStream stream, @Nonnull final Class<T> typeClass) {
return KiotaSerialization.deserialize(CONTENT_TYPE, stream, typeClass);
}
/**
* Deserializes the given string to a model object
* @param <T> the type of the value to deserialize
* @param value the string to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final String value, @Nonnull final Class<T> typeClass) throws IOException {
return KiotaSerialization.deserialize(CONTENT_TYPE, value, typeClass);
}
/**
* Deserializes the given stream to a collection of model objects
* @param <T> the type of the value to deserialize
* @param stream the stream to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final InputStream stream, @Nonnull final Class<T> typeClass) {
return KiotaSerialization.deserializeCollection(CONTENT_TYPE, stream, typeClass);
}
/**
* Deserializes the given string to a collection of model objects
* @param <T> the type of the value to deserialize
* @param value the string to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final String value, @Nonnull final Class<T> typeClass) throws IOException {
return KiotaSerialization.deserializeCollection(CONTENT_TYPE, value, typeClass);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
package com.microsoft.kiota.serialization;
/**
* Serialization helpers for kiota models.
*/

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Objects;

import com.microsoft.kiota.Compatibility;

import jakarta.annotation.Nonnull;
/**
* Helper methods for serialization of kiota models
*/
public final class KiotaSerialization {
private static final String CHARSET_NAME = "UTF-8";
private KiotaSerialization() {}
/**
* Serializes the given value to a stream
* @param <T> the type of the value to serialize
* @param contentType the content type to use for serialization
* @param value the value to serialize
* @return the serialized value as a stream
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> InputStream serializeAsStream(@Nonnull final String contentType, @Nonnull final T value) throws IOException {
try(final SerializationWriter writer = getSerializationWriter(contentType, value)) {
writer.writeObjectValue("", value);
return writer.getSerializedContent();
}
}
/**
* Serializes the given value to a string
* @param <T> the type of the value to serialize
* @param contentType the content type to use for serialization
* @param value the value to serialize
* @return the serialized value as a string
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> String serializeAsString(@Nonnull final String contentType, @Nonnull final T value) throws IOException {
try(final InputStream stream = serializeAsStream(contentType, value)) {
return new String(Compatibility.readAllBytes(stream), CHARSET_NAME);
}
}
/**
* Serializes the given value to a stream
* @param <T> the type of the value to serialize
* @param contentType the content type to use for serialization
* @param values the values to serialize
* @return the serialized value as a stream
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> InputStream serializeAsStream(@Nonnull final String contentType, @Nonnull final Iterable<T> values) throws IOException
{
try(final SerializationWriter writer = getSerializationWriter(contentType, values)) {
writer.writeCollectionOfObjectValues("", values);
return writer.getSerializedContent();
}
}
/**
* Serializes the given value to a string
* @param <T> the type of the value to serialize
* @param contentType the content type to use for serialization
* @param values the values to serialize
* @return the serialized value as a string
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> String serializeAsString(@Nonnull final String contentType, @Nonnull final Iterable<T> values) throws IOException {
try(final InputStream stream = serializeAsStream(contentType, values)) {
return new String(Compatibility.readAllBytes(stream), CHARSET_NAME);
}
}
private static SerializationWriter getSerializationWriter(@Nonnull final String contentType, @Nonnull final Object value) {
Objects.requireNonNull(contentType);
Objects.requireNonNull(value);
if (contentType.isEmpty()) {
throw new NullPointerException("content type cannot be empty");
}
return SerializationWriterFactoryRegistry.defaultInstance.getSerializationWriter(contentType);
}
/**
* Deserializes the given stream to a model object
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param stream the stream to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final String contentType, @Nonnull final InputStream stream, @Nonnull final ParsableFactory<T> parsableFactory) {
final ParseNode parseNode = getRootParseNode(contentType, stream, parsableFactory);
return parseNode.getObjectValue(parsableFactory);
}
private static <T extends Parsable> ParseNode getRootParseNode(@Nonnull final String contentType, @Nonnull final InputStream stream, @Nonnull final ParsableFactory<T> parsableFactory) {
Objects.requireNonNull(contentType);
Objects.requireNonNull(stream);
Objects.requireNonNull(parsableFactory);
if (contentType.isEmpty()) {
throw new NullPointerException("content type cannot be empty");
}
return ParseNodeFactoryRegistry.defaultInstance.getParseNode(contentType, stream);
}
private static InputStream getInputStreamFromString(@Nonnull final String value) throws UnsupportedEncodingException {
Objects.requireNonNull(value);
return new ByteArrayInputStream(value.getBytes(CHARSET_NAME));
}
/**
* Deserializes the given string to a model object
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param value the string to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final String contentType, @Nonnull final String value, @Nonnull final ParsableFactory<T> parsableFactory) throws IOException {
try (final InputStream stream = getInputStreamFromString(value)) {
return deserialize(contentType, stream, parsableFactory);
}
}
/**
* Deserializes the given string to a collection of model objects
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param value the string to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final String contentType, @Nonnull final String value, @Nonnull final ParsableFactory<T> parsableFactory) throws IOException {
try (final InputStream stream = getInputStreamFromString(value)) {
return deserializeCollection(contentType, stream, parsableFactory);
}
}
/**
* Deserializes the given stream to a collection of model objects
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param stream the stream to deserialize
* @param parsableFactory the factory to use for creating the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final String contentType, @Nonnull final InputStream stream, @Nonnull final ParsableFactory<T> parsableFactory) {
final ParseNode parseNode = getRootParseNode(contentType, stream, parsableFactory);
return parseNode.getCollectionOfObjectValues(parsableFactory);
}
/**
* Deserializes the given stream to a model object
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param stream the stream to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final String contentType, @Nonnull final InputStream stream, @Nonnull final Class<T> typeClass) {
return deserialize(contentType, stream, getFactoryMethodFromType(typeClass));
}
/**
* Deserializes the given string to a model object
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param value the string to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> T deserialize(@Nonnull final String contentType, @Nonnull final String value, @Nonnull final Class<T> typeClass) throws IOException {
return deserialize(contentType, value, getFactoryMethodFromType(typeClass));
}
/**
* Deserializes the given stream to a collection of model objects
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param stream the stream to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final String contentType, @Nonnull final InputStream stream, @Nonnull final Class<T> typeClass) {
return deserializeCollection(contentType, stream, getFactoryMethodFromType(typeClass));
}
/**
* Deserializes the given string to a collection of model objects
* @param <T> the type of the value to deserialize
* @param contentType the content type to use for deserialization
* @param value the string to deserialize
* @param typeClass the class of the model object
* @return the deserialized value
* @throws IOException when the stream cannot be closed or read.
*/
@Nonnull
public static <T extends Parsable> List<T> deserializeCollection(@Nonnull final String contentType, @Nonnull final String value, @Nonnull final Class<T> typeClass) throws IOException {
return deserializeCollection(contentType, value, getFactoryMethodFromType(typeClass));
}
@Nonnull
@SuppressWarnings("unchecked")
private static <T extends Parsable> ParsableFactory<T> getFactoryMethodFromType(@Nonnull final Class<T> type) {
Objects.requireNonNull(type);
try {
final Method method = type.getMethod("createFromDiscriminatorValue", ParseNode.class);
return node -> {
try {
return (T)method.invoke(null, node);
} catch (final Exception e) {
throw new RuntimeException(e);
}
};
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ public class SerializationWriterFactoryRegistry implements SerializationWriterFa
/** Default constructor for the registry. */
public SerializationWriterFactoryRegistry() {}
/** Default singleton instance of the registry to be used when registering new factories that should be available by default. */
public final static SerializationWriterFactoryRegistry defaultInstance = new SerializationWriterFactoryRegistry();
public static final SerializationWriterFactoryRegistry defaultInstance = new SerializationWriterFactoryRegistry();
/** List of factories that are registered by content type. */
@Nonnull
public final HashMap<String, SerializationWriterFactory> contentTypeAssociatedFactories = new HashMap<>();
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package com.microsoft.kiota.serialization;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

import org.junit.jupiter.api.Test;

import com.microsoft.kiota.serialization.mocks.TestEntity;

class DeserializationHelpersTest {
private final static String _jsonContentType = "application/json";
private final static String _charset = "utf-8";
@Test
void defensive() {
assertThrows(NullPointerException.class, () -> KiotaSerialization.deserialize(null, (InputStream)null, TestEntity::createFromDiscriminatorValue));
assertThrows(NullPointerException.class, () -> KiotaSerialization.deserialize(_jsonContentType, (InputStream)null, TestEntity::createFromDiscriminatorValue));
assertThrows(NullPointerException.class, () -> KiotaSerialization.deserialize(_jsonContentType, new ByteArrayInputStream("{}".getBytes(_charset)), (ParsableFactory<TestEntity>)null));
}
@Test
void defensiveCollection() {
assertThrows(NullPointerException.class, () -> KiotaSerialization.deserializeCollection(null, (InputStream)null, TestEntity::createFromDiscriminatorValue));
assertThrows(NullPointerException.class, () -> KiotaSerialization.deserializeCollection(_jsonContentType, (InputStream)null, TestEntity::createFromDiscriminatorValue));
assertThrows(NullPointerException.class, () -> KiotaSerialization.deserializeCollection(_jsonContentType, new ByteArrayInputStream("{}".getBytes(_charset)), (ParsableFactory<TestEntity>)null));
}
@Test
void deserializesObjectWithoutReflection() throws IOException {
final String strValue = "{'id':'123'}";
final ParseNode mockParseNode = mock(ParseNode.class);
when(mockParseNode.getObjectValue(any())).thenReturn(new TestEntity() {{
setId("123");
}});
final ParseNodeFactory mockParseNodeFactory = mock(ParseNodeFactory.class);
when(mockParseNodeFactory.getParseNode(any(), any())).thenReturn(mockParseNode);
ParseNodeFactoryRegistry.defaultInstance.contentTypeAssociatedFactories.put(_jsonContentType, mockParseNodeFactory);

final var result = KiotaSerialization.deserialize(_jsonContentType, strValue, TestEntity::createFromDiscriminatorValue);
assertEquals("123", result.getId());
}
@Test
void deserializesObjectWithReflection() throws IOException {
final String strValue = "{'id':'123'}";
final ParseNode mockParseNode = mock(ParseNode.class);
when(mockParseNode.getObjectValue(any())).thenReturn(new TestEntity() {{
setId("123");
}});
final ParseNodeFactory mockParseNodeFactory = mock(ParseNodeFactory.class);
when(mockParseNodeFactory.getParseNode(any(), any())).thenReturn(mockParseNode);
ParseNodeFactoryRegistry.defaultInstance.contentTypeAssociatedFactories.put(_jsonContentType, mockParseNodeFactory);

final var result = KiotaSerialization.deserialize(_jsonContentType, strValue, TestEntity.class);
assertEquals("123", result.getId());
}
@Test
void deserializesCollectionOfObjects() throws IOException {
final String strValue = "{'id':'123'}";
final ParseNode mockParseNode = mock(ParseNode.class);
when(mockParseNode.getCollectionOfObjectValues(any())).thenReturn(
new ArrayList<Parsable>() {{
add(new TestEntity() {{
setId("123");
}});
}});
final ParseNodeFactory mockParseNodeFactory = mock(ParseNodeFactory.class);
when(mockParseNodeFactory.getParseNode(any(), any())).thenReturn(mockParseNode);
ParseNodeFactoryRegistry.defaultInstance.contentTypeAssociatedFactories.put(_jsonContentType, mockParseNodeFactory);

final var result = KiotaSerialization.deserializeCollection(_jsonContentType, strValue, TestEntity::createFromDiscriminatorValue);
assertEquals("123", result.get(0).getId());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.microsoft.kiota.serialization;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;

import org.junit.jupiter.api.Test;

import com.microsoft.kiota.serialization.mocks.TestEntity;

class SerializationHelpersTest {
private final static String _jsonContentType = "application/json";
private final static String _charset = "utf-8";
@Test
void defensive() {
assertThrows(NullPointerException.class, () -> KiotaSerialization.serializeAsStream(null, (Parsable)null));
assertThrows(NullPointerException.class, () -> KiotaSerialization.serializeAsStream(_jsonContentType, (Parsable)null));
}
@Test
void defensiveCollection() {
assertThrows(NullPointerException.class, () -> KiotaSerialization.serializeAsStream(null, (Iterable<Parsable>)null));
assertThrows(NullPointerException.class, () -> KiotaSerialization.serializeAsStream(_jsonContentType, (Iterable<Parsable>)null));
}
@Test
void serializesObject() throws IOException {
final var mockSerializationWriter = mock(SerializationWriter.class);
when(mockSerializationWriter.getSerializedContent()).thenReturn(new ByteArrayInputStream("{'id':'123'}".getBytes(_charset)));
final var mockSerializationWriterFactory = mock(SerializationWriterFactory.class);
when(mockSerializationWriterFactory.getSerializationWriter(_jsonContentType)).thenReturn(mockSerializationWriter);
SerializationWriterFactoryRegistry.defaultInstance.contentTypeAssociatedFactories.put(_jsonContentType, mockSerializationWriterFactory);
final var result = KiotaSerialization.serializeAsString(_jsonContentType, new TestEntity() {{
setId("123");
}});
assertEquals("{'id':'123'}", result);
verify(mockSerializationWriter, times(1)).writeObjectValue(eq(""), any(Parsable.class));
}
@Test
void serializesObjectCollection() throws IOException {
final var mockSerializationWriter = mock(SerializationWriter.class);
when(mockSerializationWriter.getSerializedContent()).thenReturn(new ByteArrayInputStream("[{'id':'123'}]".getBytes(_charset)));
final var mockSerializationWriterFactory = mock(SerializationWriterFactory.class);
when(mockSerializationWriterFactory.getSerializationWriter(_jsonContentType)).thenReturn(mockSerializationWriter);
SerializationWriterFactoryRegistry.defaultInstance.contentTypeAssociatedFactories.put(_jsonContentType, mockSerializationWriterFactory);
final var result = KiotaSerialization.serializeAsString(_jsonContentType,
new ArrayList<>() {{
add(new TestEntity() {{
setId("123");
}});
}});
assertEquals("[{'id':'123'}]", result);
verify(mockSerializationWriter, times(1)).writeCollectionOfObjectValues(eq(""), any());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package com.microsoft.kiota.serialization.mocks;

import com.microsoft.kiota.PeriodAndDuration;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
import java.time.OffsetDateTime;
import java.time.LocalDate;
import java.time.LocalTime;

import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.AdditionalDataHolder;

public class TestEntity implements Parsable, AdditionalDataHolder {
private String _id;
public String getId() {
return _id;
}

public void setId(String _id) {
this._id = _id;
}

private String _officeLocation;
public String getOfficeLocation() {
return _officeLocation;
}

public void setOfficeLocation(String _officeLocation) {
this._officeLocation = _officeLocation;
}

private LocalDate _birthDay;
public LocalDate getBirthDay() {
return _birthDay;
}

public void setBirthDay(LocalDate value) {
this._birthDay = value;
}

private PeriodAndDuration _workDuration;
public PeriodAndDuration getWorkDuration() {
return _workDuration;
}

public void setWorkDuration(PeriodAndDuration value) {
this._workDuration = PeriodAndDuration.ofPeriodAndDuration(value);
}

private LocalTime _startWorkTime;
public LocalTime getStartWorkTime() {
return _startWorkTime;
}

public void setStartWorkTime(LocalTime value) {
this._startWorkTime = value;
}

private LocalTime _endWorkTime;
public LocalTime getEndWorkTime() {
return _endWorkTime;
}

public void setEndWorkTime(LocalTime value) {
this._endWorkTime = value;
}

//TODO enum
private OffsetDateTime _createdDateTime;

public OffsetDateTime getCreatedDateTime() {
return _createdDateTime;
}

public void setCreatedDateTime(OffsetDateTime value) {
this._createdDateTime = value;
}

@Override
public Map<String, Consumer<ParseNode>> getFieldDeserializers() {
return new HashMap<>() {{
put("id", (n) -> {
setId(n.getStringValue());
});
put("officeLocation", (n) -> {
setOfficeLocation(n.getStringValue());
});
put("birthDay", (n) -> {
setBirthDay(n.getLocalDateValue());
});
put("workDuration", (n) -> {
setWorkDuration(n.getPeriodAndDurationValue());
});
put("startWorkTime", (n) -> {
setStartWorkTime(n.getLocalTimeValue());
});
put("endWorkTime", (n) -> {
setEndWorkTime(n.getLocalTimeValue());
});
put("createdDateTime", (n) -> {
setCreatedDateTime(n.getOffsetDateTimeValue());
});
}};
}

@Override
public void serialize(SerializationWriter writer) {
Objects.requireNonNull(writer);
writer.writeStringValue("id", getId());
writer.writeStringValue("officeLocation", getOfficeLocation());
writer.writeLocalDateValue("birthDay", getBirthDay());
writer.writePeriodAndDurationValue("workDuration", getWorkDuration());
writer.writeLocalTimeValue("startWorkTime", getStartWorkTime());
writer.writeLocalTimeValue("endWorkTime", getEndWorkTime());
writer.writeOffsetDateTimeValue("createdDateTime", getCreatedDateTime());
writer.writeAdditionalData(getAdditionalData());
}

private final Map<String, Object> _additionalData = new HashMap<>();

@Override
public Map<String, Object> getAdditionalData() {
return _additionalData;
}
@jakarta.annotation.Nonnull
public static TestEntity createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
return new TestEntity();
}
}
2 changes: 1 addition & 1 deletion components/authentication/azure/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

2 changes: 1 addition & 1 deletion components/authentication/azure/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ dependencies {
implementation 'io.opentelemetry:opentelemetry-context:1.31.0'
implementation 'com.google.guava:guava:32.1.3-jre'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
api 'com.azure:azure-core:1.44.0'
api 'com.azure:azure-core:1.44.1'

api project(':components:abstractions')
}
2 changes: 1 addition & 1 deletion components/http/okHttp/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

2 changes: 1 addition & 1 deletion components/http/okHttp/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ dependencies {
implementation 'io.opentelemetry:opentelemetry-semconv:1.30.1-alpha'
implementation 'com.google.guava:guava:32.1.3-jre'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
api 'com.squareup.okhttp3:okhttp:4.11.0'
api 'com.squareup.okhttp3:okhttp:4.12.0'

api project(':components:abstractions')
}
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ public UserAgentHandlerOption() { }
@Nonnull
private String productName = "kiota-java";
@Nonnull
private String productVersion = "0.7.1";
private String productVersion = "0.8.0";
/**
* Gets the product name to be used in the user agent header
* @return the product name
2 changes: 1 addition & 1 deletion components/serialization/form/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

2 changes: 1 addition & 1 deletion components/serialization/json/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

2 changes: 1 addition & 1 deletion components/serialization/multipart/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

2 changes: 1 addition & 1 deletion components/serialization/text/build.gradle
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '5.1.5'
id 'com.github.spotbugs' version '5.2.1'
id "org.sonarqube" version "4.4.1.3373"
}

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -25,8 +25,8 @@ org.gradle.caching=true

mavenGroupId = com.microsoft.kiota
mavenMajorVersion = 0
mavenMinorVersion = 7
mavenPatchVersion = 8
mavenMinorVersion = 8
mavenPatchVersion = 0
mavenArtifactSuffix =

#These values are used to run functional tests