From f0eaed8adfd26a814b34052322675297fa85a896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Thu, 22 Feb 2024 14:13:21 +0100 Subject: [PATCH 01/11] Update NuGet versions to pre-release. --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 6fbac54d..bc5dd56d 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index ca3f4275..f660b88b 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -46,9 +46,9 @@ - - - + + + From ff39a47eb61ab2cee4fdc61058e90b5392115ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sat, 24 Feb 2024 02:05:28 +0100 Subject: [PATCH 02/11] Remove "using Newtonsoft.Json" --- Lombiq.VueJs/Models/GetPageFromQueryResult.cs | 2 +- Lombiq.VueJs/Models/UrlAndText.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lombiq.VueJs/Models/GetPageFromQueryResult.cs b/Lombiq.VueJs/Models/GetPageFromQueryResult.cs index 4f5f5112..c36ab914 100644 --- a/Lombiq.VueJs/Models/GetPageFromQueryResult.cs +++ b/Lombiq.VueJs/Models/GetPageFromQueryResult.cs @@ -4,7 +4,7 @@ namespace Lombiq.VueJs.Models; -[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] +[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] public class GetPageFromQueryResult { public IEnumerable Items { get; set; } diff --git a/Lombiq.VueJs/Models/UrlAndText.cs b/Lombiq.VueJs/Models/UrlAndText.cs index c6d02697..ec1f9e89 100644 --- a/Lombiq.VueJs/Models/UrlAndText.cs +++ b/Lombiq.VueJs/Models/UrlAndText.cs @@ -3,7 +3,7 @@ namespace Lombiq.VueJs.Models; -[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] +[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] public class UrlAndText { public string Url { get; set; } From 91e6c68e69b6081e0f5c95e3f49b4735af69738b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sat, 24 Feb 2024 13:16:45 +0100 Subject: [PATCH 03/11] Fix compilation errors. --- Lombiq.VueJs/Models/GetPageFromQueryResult.cs | 3 +-- Lombiq.VueJs/Models/UrlAndText.cs | 3 +-- ...esVueSingleFileComponentShapeAmenderBase.cs | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Lombiq.VueJs/Models/GetPageFromQueryResult.cs b/Lombiq.VueJs/Models/GetPageFromQueryResult.cs index c36ab914..49662268 100644 --- a/Lombiq.VueJs/Models/GetPageFromQueryResult.cs +++ b/Lombiq.VueJs/Models/GetPageFromQueryResult.cs @@ -1,6 +1,5 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; using System.Collections.Generic; +using System.Text.Json.Serialization; namespace Lombiq.VueJs.Models; diff --git a/Lombiq.VueJs/Models/UrlAndText.cs b/Lombiq.VueJs/Models/UrlAndText.cs index ec1f9e89..e5dbe21e 100644 --- a/Lombiq.VueJs/Models/UrlAndText.cs +++ b/Lombiq.VueJs/Models/UrlAndText.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; +using System.Text.Json.Serialization; namespace Lombiq.VueJs.Models; diff --git a/Lombiq.VueJs/Services/ServerSideValuesVueSingleFileComponentShapeAmenderBase.cs b/Lombiq.VueJs/Services/ServerSideValuesVueSingleFileComponentShapeAmenderBase.cs index 18403a37..9787b212 100644 --- a/Lombiq.VueJs/Services/ServerSideValuesVueSingleFileComponentShapeAmenderBase.cs +++ b/Lombiq.VueJs/Services/ServerSideValuesVueSingleFileComponentShapeAmenderBase.cs @@ -1,8 +1,7 @@ using Microsoft.AspNetCore.Html; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; using System.Collections.Generic; using System.Linq; +using System.Text.Json; using System.Threading.Tasks; namespace Lombiq.VueJs.Services; @@ -20,6 +19,12 @@ namespace Lombiq.VueJs.Services; /// public abstract class ServerSideValuesVueSingleFileComponentShapeAmenderBase : IVueSingleFileComponentShapeAmender { + private static readonly JsonSerializerOptions _camelCaseJsonSerializerOptions = new() + { + WriteIndented = false, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + }; + /// /// Gets the value used to compare in . If this value is then will be called on every Vue.js shape, otherwise only if its name is the value of > PrependAsync(string shapeName) { if (ShapeName != null && ShapeName != shapeName) return Enumerable.Empty(); - var values = await GetPropertyValueAsync(shapeName); - var json = JsonConvert.SerializeObject( - values, - Formatting.None, - new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); + var propertyName = JsonSerializer.Serialize(PropertyName); + var json = JsonSerializer.SerializeToNode(await GetPropertyValueAsync(shapeName), _camelCaseJsonSerializerOptions); return new[] { new HtmlString( ""), }; } From 312f126fb2bc3e449426c596a0ed82f13c1df8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Mon, 4 Mar 2024 00:22:21 +0100 Subject: [PATCH 04/11] Update OC to latest (because of bug fix for WorkflowTypeStep) --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 6740c6a1..5b4e3fc7 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index 85406a8e..a819b352 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -46,9 +46,9 @@ - - - + + + From b37e855edeed3383ab923c2a26f4e29cfef9f715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Fri, 8 Mar 2024 00:09:22 +0100 Subject: [PATCH 05/11] Update OC preview version. --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 5b4e3fc7..05253e01 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index a819b352..736d01c5 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -46,9 +46,9 @@ - - - + + + From 1c564935bce5082e456446333627179979a924bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 13 Mar 2024 06:16:06 +0100 Subject: [PATCH 06/11] Update OC package --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 05253e01..a992f8a7 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index 736d01c5..bcb5f4a3 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -46,9 +46,9 @@ - - - + + + From 086a7165b1d5efdaf5830f5cc3941aa04cbee8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Tue, 23 Apr 2024 17:17:30 +0200 Subject: [PATCH 07/11] Update OC preview version. --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index a992f8a7..4be75039 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index bcb5f4a3..0e389c2a 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -46,9 +46,9 @@ - - - + + + From 2d171a0fd6c58336aae5541d2ccc8fe8ccfc1dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sat, 27 Apr 2024 19:31:53 +0200 Subject: [PATCH 08/11] Update OC package version. --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 4be75039..82aa43c2 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index 0e389c2a..bc765377 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -46,9 +46,9 @@ - - - + + + From 16af6c712fd956f17139efb1510e222ef5cb6a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sat, 4 May 2024 12:57:04 +0200 Subject: [PATCH 09/11] Update OC versions --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 82aa43c2..07c669bf 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index be54655f..71c99815 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -13,7 +13,7 @@ $(SolutionDir)src\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.SourceGenerators\bin\Release\netstandard2.0\Lombiq.HelpfulLibraries.SourceGenerators.dll - + @@ -57,9 +57,9 @@ - - - + + + From 887905352fe06da0ce42a3d1e494884080dc76f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Tue, 7 May 2024 21:08:59 +0200 Subject: [PATCH 10/11] Update OC to the latest preview. --- Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj | 8 ++++---- Lombiq.VueJs/Lombiq.VueJs.csproj | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj index 07c669bf..9c7cb585 100644 --- a/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj +++ b/Lombiq.VueJs.Samples/Lombiq.VueJs.Samples.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/Lombiq.VueJs/Lombiq.VueJs.csproj b/Lombiq.VueJs/Lombiq.VueJs.csproj index 71c99815..37795b66 100644 --- a/Lombiq.VueJs/Lombiq.VueJs.csproj +++ b/Lombiq.VueJs/Lombiq.VueJs.csproj @@ -57,9 +57,9 @@ - - - + + + From 5c2c52f50bac97e5638662c5f60ee649d44a1839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sun, 12 May 2024 19:11:06 +0200 Subject: [PATCH 11/11] Get rid of `[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]`. --- Lombiq.VueJs/Models/GetPageFromQueryResult.cs | 6 +++++- Lombiq.VueJs/Models/UrlAndText.cs | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Lombiq.VueJs/Models/GetPageFromQueryResult.cs b/Lombiq.VueJs/Models/GetPageFromQueryResult.cs index 49662268..4d1262ec 100644 --- a/Lombiq.VueJs/Models/GetPageFromQueryResult.cs +++ b/Lombiq.VueJs/Models/GetPageFromQueryResult.cs @@ -3,10 +3,14 @@ namespace Lombiq.VueJs.Models; -[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] public class GetPageFromQueryResult { + [JsonPropertyName("items")] public IEnumerable Items { get; set; } + + [JsonPropertyName("pageSize")] public int PageSize { get; set; } + + [JsonPropertyName("pageCount")] public int PageCount { get; set; } } diff --git a/Lombiq.VueJs/Models/UrlAndText.cs b/Lombiq.VueJs/Models/UrlAndText.cs index e5dbe21e..c8df81da 100644 --- a/Lombiq.VueJs/Models/UrlAndText.cs +++ b/Lombiq.VueJs/Models/UrlAndText.cs @@ -2,9 +2,11 @@ namespace Lombiq.VueJs.Models; -[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] public class UrlAndText { + [JsonPropertyName("url")] public string Url { get; set; } + + [JsonPropertyName("text")] public string Text { get; set; } }