ParameterStyleParsers.OpenAPI 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ParameterStyleParsers.OpenAPI --version 1.1.1
                    
NuGet\Install-Package ParameterStyleParsers.OpenAPI -Version 1.1.1
                    
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="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ParameterStyleParsers.OpenAPI" Version="1.1.1" />
                    
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 1.1.1
                    
#r "nuget: ParameterStyleParsers.OpenAPI, 1.1.1"
                    
#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@1.1.1
                    
#: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=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=ParameterStyleParsers.OpenAPI&version=1.1.1
                    
Install as a Cake Tool

OpenAPI.ParameterStyleParsers

Parameter style parsers for OpenAPI.

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

Continuous Delivery

Installation

dotnet add package ParameterStyleParsers.OpenAPI

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

Getting Started

Create a parser by providing the OpenAPI parameter specification.

OpenAPI 3.1

var parser = OpenAPI.ParameterStyleParsers.ParameterValueParserFactory.OpenApi31(
    """
    {
        "name": "color",
        "in": "query",
        "schema": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "style": "form",
        "explode": true
    }
    """);

OpenAPI 2.0

var parser = OpenAPI.ParameterStyleParsers.ParameterValueParserFactory.OpenApi20(
    """
    {
        "name": "color",
        "in": "query",
        "required": false,
        "type": "array",
        "items": {
            "type": "string"
        },
        "collectionFormat": "multi"
    }
    """);

Parse a style serialized parameter

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

Serialize json to a parameter style.

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

Schema References

Json pointers represented as URI fragments are supported, other URI's are currently not. It is possible to bring your own Json Schema implementation though.

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.
  • net8.0

    • No dependencies.

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.4.0-pre-98ae1991 0 1/11/2026
1.4.0-pre-314bd41e 0 1/11/2026
1.3.0 0 1/10/2026
1.3.0-pre-6a5eb765 0 1/10/2026
1.2.1-pre-f6232e95 0 1/10/2026
1.2.1-pre-a083f46c 0 1/10/2026
1.2.1-pre-0596ce88 0 1/10/2026
1.2.0 22 1/10/2026
1.2.0-pre-aa08d0af 22 1/10/2026
1.2.0-pre-63f9807e 20 1/10/2026
1.2.0-pre-452c2def 24 1/10/2026
1.2.0-pre-2203c5c2 24 1/10/2026
1.1.1 302 12/17/2025
1.1.1-pre-90b9f6b9 110 12/13/2025
1.1.1-pre-82653491 140 12/14/2025
1.1.0 199 11/25/2025
1.1.0-pre-de0dd975 521 7/23/2025
1.1.0-pre-c3646a77 186 11/24/2025
1.1.0-pre-be2cd81c 181 11/25/2025
1.1.0-pre-bb7b5b6f 515 7/21/2025
1.1.0-pre-ab0f6177 173 7/16/2025
1.1.0-pre-99058510 519 7/21/2025
1.1.0-pre-73b80428 522 7/24/2025
1.1.0-pre-73303ae8 168 7/17/2025
1.1.0-pre-55d08346 513 7/23/2025
1.1.0-pre-29539c51 177 7/16/2025
1.0.3 262 6/7/2024
1.0.3-pre-5f844d02 154 6/7/2024
1.0.2 156 6/7/2024
1.0.2-pre-59512787 153 6/7/2024
1.0.1 213 6/4/2024
1.0.1-pre-974c1933 141 6/4/2024
1.0.0 398 5/29/2024
1.0.0-pre-fc3e8a7a 157 5/29/2024
1.0.0-pre-72c5ba6d 163 5/27/2024
1.0.0-pre-4465deeb 159 5/28/2024
0.1.2-pre-277f96df 155 5/24/2024
0.1.1 167 5/22/2024
0.1.1-pre-02a920e8 154 5/22/2024
0.1.0 224 4/17/2024
0.1.0-pre-62b5499b 179 4/17/2024

## [v1.1.1](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/compare/34a447c979fc7fea264d4bca9d46fa22aecbad2a...db1b004668cf1b075cf93a811b58da7007eaff87) (2025-12-17)


### Bug Fixes

* **openapi 2.0:** catch parsing problems when parsing primitives ([f9d7c15](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/f9d7c1585bb2198b3213aee37791dcff0da58722))
* **openapi 3.1:** catch parsing problems when parsing primitives ([90b9f6b](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/90b9f6b99ab07fd25ee8d9f9d3b41df2446acc2c))
* **openapi 3.1:** convert any styled value to json no matter the type as the input value might not correspond ([8265349](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/826534918feea8d643a91771f396eb6adb717b01))
* **openapi:** convert any styled value to json no matter the type as the input value might not correspond ([d1dd084](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/d1dd084254e0bf323ac63cd85486bf4054548998))