Yoh.Text.Json.NamingPolicies 1.1.2

dotnet add package Yoh.Text.Json.NamingPolicies --version 1.1.2                
NuGet\Install-Package Yoh.Text.Json.NamingPolicies -Version 1.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Yoh.Text.Json.NamingPolicies" Version="1.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Yoh.Text.Json.NamingPolicies --version 1.1.2                
#r "nuget: Yoh.Text.Json.NamingPolicies, 1.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Yoh.Text.Json.NamingPolicies as a Cake Addin
#addin nuget:?package=Yoh.Text.Json.NamingPolicies&version=1.1.2

// Install Yoh.Text.Json.NamingPolicies as a Cake Tool
#tool nuget:?package=Yoh.Text.Json.NamingPolicies&version=1.1.2                

The package provides a set of naming policies for the system JSON serializer in .NET which are missed or incorrectly implemented.

The snake and kebab policies from that package are a part of System.Text.Json since the moment when this pull request was merged, but since reworkin policies in .NET to match JSON.NET there are some behavior differences between System.Text.Json and this package. Choose one depending on your priorities:

  • Yoh.Text.Json.NamingPolicies suits better for communications with services from other ecosystems;
  • System.Text.Json for compatibility with JSON.NET based services.

Camel Case

Rewrites an input string changing the case of each word by lower casing the first and capitalizing the rest. All non letter or digin charactwrs are ignored.

namespace Yoh.Text.Json.NamingPolicies;

public static class JsonNamingPolicies
{
    public static JsonNamingPolicy CamelCase { get; }
}
Input Output
XMLHttpRequest xmlHttpRequest
camelCase camelCase
camelCase camelCase
snake_case snakeCase
sNAKE_CASE snakeCase
kebab-case kebabCase
kEBAB-CASE kebabCase
double space doubleSpace
double__underscore doubleUnderscore
abc abc
abC abC
aBc aBc
aBC aBc
aBc aBc
aBC abc
abc123def456 abc123def456
abc123Def456 abc123Def456
abc123DEF456 abc123Def456
aBC123DEF456 abc123def456
aBC123def456 abc123def456
abc123def456 abc123def456
ABC abc
aBC abc
ABC abc
ABC def abcDef

Pascal Case

Rewrites an input string capitalizing each word. All non letter or digin charactwrs are ignored.

namespace Yoh.Text.Json.NamingPolicies;

public static class JsonNamingPolicies
{
    public static JsonNamingPolicy PascalCase { get; }
}
Input Output
XMLHttpRequest XmlHttpRequest
camelCase CamelCase
camelCase CamelCase
snake_case SnakeCase
sNAKE_CASE SnakeCase
kebab-case KebabCase
kEBAB-CASE KebabCase
double space DoubleSpace
double__underscore DoubleUnderscore
abc Abc
abC AbC
aBc ABc
aBC ABc
aBc ABc
aBC Abc
abc123def456 Abc123def456
abc123Def456 Abc123Def456
abc123DEF456 Abc123Def456
aBC123DEF456 Abc123def456
aBC123def456 Abc123def456
abc123def456 Abc123def456
ABC Abc
aBC Abc
ABC Abc
ABC def AbcDef

Snake Case

Rewrites an input string changing the case of each word and connecting them using underscores. All non letter or digit characters are ignored.

namespace Yoh.Text.Json.NamingPolicies;

public static class JsonNamingPolicies
{
    public static JsonNamingPolicy SnakeLowerCase { get; }
    public static JsonNamingPolicy SnakeUpperCase { get; }
}
Input Output (lower case) Output (upper case)
XMLHttpRequest xml_http_request XML_HTTP_REQUEST
camelCase camel_case CAMEL_CASE
CamelCase camel_case CAMEL_CASE
snake_case snake_case SNAKE_CASE
SNAKE_CASE snake_case SNAKE_CASE
kebab-case kebab_case KEBAB_CASE
KEBAB-CASE kebab_case KEBAB_CASE
double space double_space DOUBLE_SPACE
double__underscore double_underscore DOUBLE_UNDERSCORE
abc abc ABC
abC ab_c AB_C
aBc a_bc A_BC
aBC a_bc A_BC
ABc a_bc A_BC
ABC abc ABC
abc123def456 abc123def456 ABC123DEF456
abc123Def456 abc123_def456 ABC123_DEF456
abc123DEF456 abc123_def456 ABC123_DEF456
ABC123DEF456 abc123def456 ABC123DEF456
ABC123def456 abc123def456 ABC123DEF456
Abc123def456 abc123def456 ABC123DEF456
abc abc ABC
abc abc ABC
abc abc ABC
abc def abc_def ABC_DEF

Kebab Case

Rewrites an input string changing the case of each word and connecting them using hyphens. All non letter or digit characters are ignored.

namespace Yoh.Text.Json.NamingPolicies;

public static class JsonNamingPolicies
{
    public static JsonNamingPolicy KebabLowerCase { get; }
    public static JsonNamingPolicy KebabUpperCase { get; }
}
Input Output (lower case) Output (upper case)
XMLHttpRequest xml-http-request XML-HTTP-REQUEST
camelCase camel-case CAMEL-CASE
CamelCase camel-case CAMEL-CASE
snake_case snake-case SNAKE-CASE
SNAKE_CASE snake-case SNAKE-CASE
kebab-case kebab-case KEBAB-CASE
KEBAB-CASE kebab-case KEBAB-CASE
double space double-space DOUBLE-SPACE
double__underscore double-underscore DOUBLE-UNDERSCORE
abc abc ABC
abC ab-c AB-C
aBc a-bc A-BC
aBC a-bc A-BC
ABc a-bc A-BC
ABC abc ABC
abc123def456 abc123def456 ABC123DEF456
abc123Def456 abc123-def456 ABC123-DEF456
abc123DEF456 abc123-def456 ABC123-DEF456
ABC123DEF456 abc123def456 ABC123DEF456
ABC123def456 abc123def456 ABC123DEF456
Abc123def456 abc123def456 ABC123DEF456
abc abc ABC
abc abc ABC
abc abc ABC
abc def abc-def ABC-DEF
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Yoh.Text.Json.NamingPolicies:

Package Downloads
Vonage

Official C#/.NET wrapper for the Vonage API. To use it you will need a Vonage account. Sign up for free at vonage.com. For full API documentation refer to developer.vonage.com.

OEmbed

A simple oEmbed consumer library for .NET

Vonage.Signed

Official C#/.NET wrapper for the Vonage API. To use it you will need a Vonage account. Sign up for free at vonage.com. For full API documentation refer to developer.vonage.com.

Nibblebit.Ecurring

Package Description

Vonage.ATT

Official .NET client for Vonage Network APIs.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Yoh.Text.Json.NamingPolicies:

Repository Stars
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
Vonage/vonage-dotnet-sdk
Vonage REST API client for .NET, written in C#. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Version Downloads Last updated
1.1.2 87,315 4/18/2024
1.1.1 112 4/18/2024
1.1.0 1,559 4/12/2024
1.0.0 414,796 10/20/2022
0.3.2 5,734 10/11/2022
0.3.1 766 10/8/2022
0.3.0 589 10/2/2022
0.2.1 20,001 8/10/2022
0.2.0 42,544 4/6/2022
0.1.1 2,993 2/24/2022
0.1.0 857 3/21/2021