add shorthand functions for serialization
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start by reading the requirements in microsoft/kiota#3406 and inspect the existing model and collection serialization/deserialization abstractions. Define the supported string and stream helpers, content-type and JSON variants, reflection or callback paths, and confirm that the complete API is covered without naming conflicts.
Written by the indexing model from the issue text.
Description
to facilitate serialization and deserialization of models and collections of models, we're adding static helper functions.
More details to be found at https://github.com/microsoft/kiota/issues/3406
For serialization we need:
- Serialize(contentType, model): string
- Serialize(contentType, model): stream
- SerializeCollection(contentType, models): string
- SerializeCollection(contentType, models): stream
- Serialize(model): stream (maps to same one passing the json content type as a constant)
- Serialize(model): string (same)
- Serialize(models): stream (same)
- Serialize(models): string (same)
Note: if converting from stream to string is trivial we can ommit the string overloads
Note: if another parameter for the serialization method needs to be added, feel free to do so
Note: if both a string and and stream method need to be added, but can't have the same name, name the string methods with AsString suffix
Note: if the Json methods and the ones accepting the same content type can't have the same namde/would need to be aliased in the consuming code to avoid conflicts, as a ToJsonSuffix (full convention with string SerializeCollectionToJsonAsString)
For deserialization we need:
- Deserialize(contentType, stream, createTFromDiscriminatorMethod): T
- Deserialize(contentType, string, createTFromDiscriminatorMethod): T
- Deserialize(contentType, stream): T (uses reflection, only if possible, calls into the previous one)
- Deserialize(contentType, string): T (same)
- DeserializeCollection(contentType, stream, createCallback): T[]
- DeserializeCollection(contentType, string, createCallback): T[]
- reflection version x2
- Json equivalent with constant for all the previous
Note: the same notes as serialization apply
Note: if the collection and single methods can have the same name, make them same
- Dominant language
- Python
- Stars
- 31
- Forks
- 39
- Avg merge
- 11h 45m
- Merged PRs (30d)
- 42
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/kiota-python
-
help wanted type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/kiota-python#477 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
microsoft/kiota-python#737 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/kiota-python#722 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
microsoft/kiota-python#533 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/kiota-python#501 · 1 reaction ·
All issues in microsoft/kiota-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100