-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from kiota-community/json
Support for Json (de)serialization
- v0.0.1
- microsoft_kiota_serialization_text-v0.0.2
- microsoft_kiota_serialization_text-v0.0.1
- microsoft_kiota_serialization_multipart-v0.0.2
- microsoft_kiota_serialization_multipart-v0.0.1
- microsoft_kiota_serialization_json-v0.0.2
- microsoft_kiota_serialization_json-v0.0.1
- microsoft_kiota_serialization_form-v0.0.2
- microsoft_kiota_serialization_form-v0.0.1
- microsoft_kiota_http-v0.0.3
- microsoft_kiota_http-v0.0.2
- microsoft_kiota_http-v0.0.1
- microsoft_kiota_bundle-v0.0.3
- microsoft_kiota_bundle-v0.0.2
- microsoft_kiota_bundle-v0.0.1
- microsoft_kiota_abstractions-v0.0.2
- microsoft_kiota_abstractions-v0.0.1
Showing
50 changed files
with
2,176 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
* @ricardoboss | ||
/packages/kiota_serialization_json @joanne-ter-maat | ||
/packages/kiota_serialization_multipart @Kees-Schotanus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/kiota_abstractions/lib/src/serialization/untyped_array.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
/// Represents an untyped node with a collection of other untyped nodes. | ||
class UntypedArray extends UntypedNode { | ||
/// Constructs an instance from the supplied [collection] | ||
const UntypedArray(this.collection); | ||
|
||
final Iterable<UntypedNode> collection; | ||
|
||
@override | ||
Iterable<UntypedNode> getValue() { | ||
return collection; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/kiota_abstractions/lib/src/serialization/untyped_boolean.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
class UntypedBoolean extends UntypedNode { | ||
const UntypedBoolean({required this.value}); | ||
|
||
final bool value; | ||
|
||
@override | ||
bool? getValue() { | ||
return value; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/kiota_abstractions/lib/src/serialization/untyped_double.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
class UntypedDouble extends UntypedNode { | ||
const UntypedDouble(this.value); | ||
|
||
final double value; | ||
|
||
@override | ||
double? getValue() { | ||
return value; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/kiota_abstractions/lib/src/serialization/untyped_integer.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
class UntypedInteger extends UntypedNode { | ||
const UntypedInteger(this.value); | ||
|
||
final int value; | ||
|
||
@override | ||
int? getValue() { | ||
return value; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/kiota_abstractions/lib/src/serialization/untyped_node.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
/// Base class for untyped node. | ||
class UntypedNode implements Parsable { | ||
const UntypedNode(); | ||
|
||
/// Creates a new [UntypedNode] instance. | ||
factory UntypedNode.createFromDiscriminatorValue(ParseNode _) { | ||
return const UntypedNode(); | ||
} | ||
|
||
/// The deserialization information for the current model. | ||
/// Returns a map of serializer methods for this object. | ||
@override | ||
Map<String, void Function(ParseNode)> getFieldDeserializers() { | ||
return {}; | ||
} | ||
|
||
/// Serializes the current object | ||
@override | ||
void serialize(SerializationWriter writer) { | ||
// no properties to serialize. This is handled by custom serialization logic. | ||
} | ||
|
||
/// Gets the value assigned to untyped node. | ||
Object? getValue() { | ||
throw Exception('getValue is implemented for derived types of UntypedNode'); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/kiota_abstractions/lib/src/serialization/untyped_null.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
class UntypedNull extends UntypedNode { | ||
const UntypedNull(); | ||
|
||
@override | ||
Object? getValue() { | ||
return null; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/kiota_abstractions/lib/src/serialization/untyped_object.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
/// Represents an untyped node with object value. | ||
class UntypedObject extends UntypedNode { | ||
const UntypedObject(this.properties); | ||
|
||
final Map<String, UntypedNode> properties; | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/kiota_abstractions/lib/src/serialization/untyped_string.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
part of '../../kiota_abstractions.dart'; | ||
|
||
class UntypedString extends UntypedNode { | ||
const UntypedString(this.value); | ||
|
||
final String value; | ||
|
||
@override | ||
String? getValue() { | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ | ||
|
||
# Avoid committing pubspec.lock for library packages; see | ||
# https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
pubspec.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Unreleased | ||
|
||
- Initial version. | ||
- Provides parsing and serialization support for the `application/json` content type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The `kiota_serialization_json` package is the Dart Json serialization library implementation to | ||
handle `application/json` responses. | ||
|
||
## Usage | ||
|
||
Install the package in the generated project: | ||
|
||
> For now, you can add the git repository as a dependency in your `pubspec.yaml` file: | ||
> | ||
> ```yaml | ||
> dependencies: | ||
> kiota_serialization_json: | ||
> git: | ||
> url: https://github.com/ricardoboss/dart_kiota.git | ||
> ref: main | ||
> path: packages/kiota_serialization_json | ||
> ``` | ||
```bash | ||
dart pub add kiota_serialization_json | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include: package:strict/analysis_options.yaml |
16 changes: 16 additions & 0 deletions
16
packages/kiota_serialization_json/lib/kiota_serialization_json.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// This library implements deserialization for application/json responses. | ||
/// | ||
/// This library is not meant to be used directly, but rather to be used as a | ||
/// dependency in the generated code. | ||
library kiota_serialization_json; | ||
|
||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
|
||
import 'package:kiota_abstractions/kiota_abstractions.dart'; | ||
import 'package:uuid/uuid_value.dart'; | ||
|
||
part 'src/json_parse_node.dart'; | ||
part 'src/json_parse_node_factory.dart'; | ||
part 'src/json_serialization_writer.dart'; | ||
part 'src/json_serialization_writer_factory.dart'; |
Oops, something went wrong.