Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

fix: missing event receivers on parse node #154

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.5] - 2024-06-26

### Changed

- Fixed a bug where new parse nodes would be missing event receivers. [#153](https://github.com/microsoft/kiota-serialization-form-dotnet/issues/153)

## [1.2.4] - 2024-05-23

### Changed
Expand Down
6 changes: 5 additions & 1 deletion src/FormParseNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
/// <inheritdoc/>
public byte? GetByteValue() => byte.TryParse(DecodedValue, out var result) ? result : null;
/// <inheritdoc/>
public IParseNode? GetChildNode(string identifier) => Fields.TryGetValue(SanitizeKey(identifier), out var value) ? new FormParseNode(value) : null;
public IParseNode? GetChildNode(string identifier) => Fields.TryGetValue(SanitizeKey(identifier), out var value) ?
new FormParseNode(value){
OnBeforeAssignFieldValues = OnBeforeAssignFieldValues,
OnAfterAssignFieldValues = OnAfterAssignFieldValues
} : null;
/// <inheritdoc/>
public IEnumerable<T> GetCollectionOfObjectValues<T>(ParsableFactory<T> factory) where T : IParsable => throw new InvalidOperationException("collections are not supported with uri form encoding");

Expand All @@ -87,7 +91,7 @@
/// Get the collection of primitives of type <typeparam name="T"/>from the form node
/// </summary>
/// <returns>A collection of objects</returns>
public IEnumerable<T> GetCollectionOfPrimitiveValues<T>()

Check warning on line 94 in src/FormParseNode.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
var genericType = typeof(T);
var primitiveValueCollection = DecodedValue.Split(new[] { ',' } , StringSplitOptions.RemoveEmptyEntries);
Expand Down Expand Up @@ -129,9 +133,9 @@
}
}
/// <inheritdoc/>
public DateTimeOffset? GetDateTimeOffsetValue() => DateTimeOffset.TryParse(DecodedValue, out var result) ? result : null;

Check warning on line 136 in src/FormParseNode.cs

View workflow job for this annotation

GitHub Actions / Build

Use a format provider when parsing date and time. (https://rules.sonarsource.com/csharp/RSPEC-6580)
/// <inheritdoc/>
public Date? GetDateValue() => DateTime.TryParse(DecodedValue, out var result) ? new Date(result) : null;

Check warning on line 138 in src/FormParseNode.cs

View workflow job for this annotation

GitHub Actions / Build

Use a format provider when parsing date and time. (https://rules.sonarsource.com/csharp/RSPEC-6580)
/// <inheritdoc/>
public decimal? GetDecimalValue() => decimal.TryParse(DecodedValue, out var result) ? result : null;
/// <inheritdoc/>
Expand Down Expand Up @@ -206,7 +210,7 @@
}

/// <inheritdoc/>
public Time? GetTimeValue() => DateTime.TryParse(DecodedValue, out var result) ? new Time(result) : null;

Check warning on line 213 in src/FormParseNode.cs

View workflow job for this annotation

GitHub Actions / Build

Use a format provider when parsing date and time. (https://rules.sonarsource.com/csharp/RSPEC-6580)

#if NET5_0_OR_GREATER
IEnumerable<T?> IParseNode.GetCollectionOfEnumValues<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] T>()
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Kiota.Serialization.Form.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageProjectUrl>https://aka.ms/kiota/docs</PackageProjectUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Deterministic>true</Deterministic>
<VersionPrefix>1.2.4</VersionPrefix>
<VersionPrefix>1.2.5</VersionPrefix>
<VersionSuffix></VersionSuffix>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Loading