microsoft / kiota-python

Abstractions library for Kiota generated Python clients
https://aka.ms/kiota/docs
MIT License
16 stars 11 forks source link

correctly serialize None in a list #386

Closed Acurisu closed 1 month ago

Acurisu commented 1 month ago

Overview

We currently have two issues:

  1. We don't support None inside lists.
  2. We convert None to 'null' when there is no key. Simply fixing issue 1 would result in ['null', 'null'] instead of [null, null].

The first issue arises when fetching, for example, all graph site pages of a site and attempting to serialize them. A specific case involves expanding canvasLayout and receiving a page without a canvasLayout, which results in pinnedItems containing [None, None, None].

Although whether this response is correct is another question, the serialization should not raise an exception in this scenario but should handle it appropriately.

Testing Instructions

I have added relevant tests. Simply run pytest to verify the fix. Running the same tests without my changes will result in an exception.

andrueastman commented 1 month ago

Thanks for opening this @Acurisu

If we were to include this change, it would however not trigger a release. Any chance you can include/modify commits to follow the conventions here https://github.com/microsoft/kiota-python/blob/main/CONTRIBUTING.md#commit-message-format

Acurisu commented 1 month ago

Thanks for opening this @Acurisu

If we were to include this change, it would however not trigger a release. Any chance you can include/modify commits to follow the conventions here https://github.com/microsoft/kiota-python/blob/main/CONTRIBUTING.md#commit-message-format

Yes of course. Sorry, thought I opened this PR as a draft.

Acurisu commented 1 month ago

Done. I hope this works out.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud