Skip to content
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.2.2] - 2026-02-25

### Fixed

Add missing `[JsonIgnore]` attributes to properties in `JsonApiDocument` which are not part of the JSON:API specification.

### Remarks

This change addresses an oversight in previous versions of the library in which utility properties belonging to `JsonApiDocument` were being (de)serialized.

## [5.2.1] - 2026-02-25

### Fixed
Expand Down Expand Up @@ -135,6 +145,7 @@ Additionally, this version aims to be more idiomatic by renaming class propertie

Initial release.

[5.2.2]: https://github.com/twcrews/jsonapi-client/compare/5.2.1...5.2.2
[5.2.1]: https://github.com/twcrews/jsonapi-client/compare/5.2.0...5.2.1
[5.2.0]: https://github.com/twcrews/jsonapi-client/compare/5.1.0...5.2.0
[5.1.0]: https://github.com/twcrews/jsonapi-client/compare/5.0.0...5.1.0
Expand Down
2 changes: 1 addition & 1 deletion Crews.Web.JsonApiClient/Crews.Web.JsonApiClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup>
<PackageId>Crews.Web.JsonApiClient</PackageId>
<PackageVersion>5.2.1</PackageVersion>
<PackageVersion>5.2.2</PackageVersion>
<Authors>Tommy Crews</Authors>
<Description>
A library containing serialization models and methods for the JSON:API specification.
Expand Down
4 changes: 4 additions & 0 deletions Crews.Web.JsonApiClient/JsonApiDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ public record JsonApiDocument
/// This property returns <see langword="true"/> if <see cref="Data"/> is a JSON array. No other validation or
/// type checking is performed.
/// </remarks>
[JsonIgnore]
public bool HasCollectionResource => Data?.ValueKind == JsonValueKind.Array;

/// <summary>
/// Gets a value indicating whether the <see cref="Errors"/> property contains one or more objects.
/// </summary>
[JsonIgnore]
public bool HasErrors => Errors is not null && Errors.Any();

/// <summary>
Expand Down Expand Up @@ -98,6 +100,7 @@ public record JsonApiDocument<T> : JsonApiDocument where T : JsonApiResource
/// <summary>
/// Gets a value indicating whether the <see cref="Data"/> property contains a single resource object.
/// </summary>
[JsonIgnore]
public new bool HasCollectionResource => false;

/// <summary>
Expand Down Expand Up @@ -131,6 +134,7 @@ public record JsonApiCollectionDocument<T> : JsonApiDocument where T : JsonApiRe
/// <summary>
/// Gets a value indicating whether the <see cref="Data"/> property contains a resource collection object.
/// </summary>
[JsonIgnore]
public new bool HasCollectionResource => true;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Crews.Web.JsonApiClient/JsonApiLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public record JsonApiLink
/// <summary>
/// Implicitly converts a string URL to a JsonApiLink instance.
/// </summary>
/// <param name="href"></param>
/// <param name="href">The URL string.</param>
public static implicit operator JsonApiLink(string href) => new() { Href = new(href) };
}