ParameterStyleParsers.OpenAPI 0.1.1-pre-02a920e8

This is a prerelease version of ParameterStyleParsers.OpenAPI.
There is a newer version of this package available.
See the version list below for details.
dotnet add package ParameterStyleParsers.OpenAPI --version 0.1.1-pre-02a920e8
                    
NuGet\Install-Package ParameterStyleParsers.OpenAPI -Version 0.1.1-pre-02a920e8
                    
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="ParameterStyleParsers.OpenAPI" Version="0.1.1-pre-02a920e8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ParameterStyleParsers.OpenAPI" Version="0.1.1-pre-02a920e8" />
                    
Directory.Packages.props
<PackageReference Include="ParameterStyleParsers.OpenAPI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ParameterStyleParsers.OpenAPI --version 0.1.1-pre-02a920e8
                    
#r "nuget: ParameterStyleParsers.OpenAPI, 0.1.1-pre-02a920e8"
                    
#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.
#:package ParameterStyleParsers.OpenAPI@0.1.1-pre-02a920e8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ParameterStyleParsers.OpenAPI&version=0.1.1-pre-02a920e8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ParameterStyleParsers.OpenAPI&version=0.1.1-pre-02a920e8&prerelease
                    
Install as a Cake Tool

OpenAPI.ParameterStyleParsers

Parameter style parsers for OpenAPI 3.1.

The examples in the OpenAPI specification doesn't match RFC6570 fully, in those cases the examples in the specification are followed.

Continuous Delivery

Installation

dotnet add package ParameterStyleParsers.OpenAPI

https://www.nuget.org/packages/ParameterStyleParsers.OpenAPI/

Getting Started

Parse the OpenAPI 3.1 parameter from the specification, and create a parameter value parser.

/* Parameter specification example:
{
    "name": "color",
    "in": "query",
    "schema": {
        "type": "array",
        "items": {
            "type": "string"
        }
    },
    "style": "form",
    "explode": true
}
*/

var parameter = OpenAPI.ParameterStyleParsers.Parameter.Parse(
    name: "color",
    style: "form",
    location: "query",
    explode: true,
    JsonSchema.FromText("""
    {
        "type": "array",
        "items": {
            "type": "string"
    }
    """)
);
var parser = OpenAPI.ParameterStyleParsers.ParameterParsers.ParameterValueParser.Create(parameter);

Parse a style serialized parameter

string styleSerializedParameter = "color=blue&color=black&color=brown";
parser.TryParse(styleSerializedParameter, out JsonNode? parameter, out string? error);
Console.WriteLine(parameter.ToJsonString());
// ["blue","black","brown"]

Serialize json to a parameter style.

var json = JsonNode.Parse("""
    ["blue","black","brown"]
""");
string styleSerializedParameter = parser.Serialize(json);
Console.WriteLine(styleSerializedParameter);
// color=blue&color=black&color=brown

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ParameterStyleParsers.OpenAPI:

Package Downloads
Evaluation.OpenAPI

Evaluates API requests and responses using OpenAPI specifications

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0-pre-de0dd975 268 7/23/2025
1.1.0-pre-bb7b5b6f 316 7/21/2025
1.1.0-pre-ab0f6177 105 7/16/2025
1.1.0-pre-99058510 318 7/21/2025
1.1.0-pre-73b80428 263 7/24/2025
1.1.0-pre-73303ae8 104 7/17/2025
1.1.0-pre-55d08346 265 7/23/2025
1.1.0-pre-29539c51 108 7/16/2025
1.0.3 173 6/7/2024
1.0.3-pre-5f844d02 117 6/7/2024
1.0.2 118 6/7/2024
1.0.2-pre-59512787 103 6/7/2024
1.0.1 164 6/4/2024
1.0.1-pre-974c1933 110 6/4/2024
1.0.0 124 5/29/2024
1.0.0-pre-fc3e8a7a 113 5/29/2024
1.0.0-pre-72c5ba6d 111 5/27/2024
1.0.0-pre-4465deeb 117 5/28/2024
0.1.2-pre-277f96df 114 5/24/2024
0.1.1 123 5/22/2024
0.1.1-pre-02a920e8 108 5/22/2024
0.1.0 171 4/17/2024
0.1.0-pre-62b5499b 124 4/17/2024