ParameterStyleParsers.OpenAPI 1.4.0

dotnet add package ParameterStyleParsers.OpenAPI --version 1.4.0
                    
NuGet\Install-Package ParameterStyleParsers.OpenAPI -Version 1.4.0
                    
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.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ParameterStyleParsers.OpenAPI" Version="1.4.0" />
                    
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.4.0
                    
#r "nuget: ParameterStyleParsers.OpenAPI, 1.4.0"
                    
#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.4.0
                    
#: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.4.0
                    
Install as a Cake Addin
#tool nuget:?package=ParameterStyleParsers.OpenAPI&version=1.4.0
                    
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 using OpenAPI.ParameterStyleParsers.ParameterValueParserFactory.

It's also possible to go via the respective parameter using OpenAPI.ParameterStyleParsers.ParameterFactory and from there use the extension method CreateParameterValueParser.

OpenAPI 3.2

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

OpenAPI 3.1

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

OpenAPI 3.0

var parser = OpenAPI.ParameterStyleParsers.ParameterValueParserFactory.OpenApi30(
    """
    {
        "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 118 1/12/2026
1.4.0-pre-a82e71ac 88 1/12/2026
1.4.0-pre-98ae1991 87 1/11/2026
1.4.0-pre-6378fba7 87 1/11/2026
1.4.0-pre-314bd41e 85 1/11/2026
1.3.0 84 1/10/2026
1.3.0-pre-6a5eb765 87 1/10/2026
1.2.1-pre-f6232e95 85 1/10/2026
1.2.1-pre-a083f46c 86 1/10/2026
1.2.1-pre-0596ce88 83 1/10/2026
1.2.0 91 1/10/2026
1.2.0-pre-aa08d0af 87 1/10/2026
1.2.0-pre-63f9807e 85 1/10/2026
1.2.0-pre-452c2def 89 1/10/2026
1.2.0-pre-2203c5c2 86 1/10/2026
1.1.1 310 12/17/2025
1.1.1-pre-90b9f6b9 122 12/13/2025
1.1.1-pre-82653491 148 12/14/2025
1.1.0 209 11/25/2025
1.1.0-pre-be2cd81c 192 11/25/2025
Loading failed

# [v1.4.0](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/compare/17f49df04752cdef10e028f12f94200c5eab3ddb...d52ba783fb3b5ca9200523ab8dcb656f797b3818) (2026-01-12)


### Bug Fixes

* **pipeDelimited:** objects in OpenAPI 3+ should include parameter name, same as it already does for arrays ([a2f7052](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/a2f7052b385000286be7b379b28d404da5fb87c5))
* **spaceDelimited:** objects in OpenAPI 3+ should include parameter name, same as it already does for arrays ([98ae199](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/98ae1991886f4e305cb1a00fa10556a8f890f20e))


### Features

* **parameter:** extract a unified interface that can be used disregarding openapi version ([a08e4f7](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/a08e4f74e6a50b53ec3d07b3f5efe368a2b9bd45))
* **parameter:** simplify creating parameters using the ParameterFactory ([a82e71a](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/a82e71ac338cd1101c834a92c4e3f3ac4fb5dccb))
* **parser:** expose if the parser expects parameter name in the value or not ([44cd745](https://github.com/Fresa/OpenAPI.ParameterStyleParsers/commit/44cd74543a8d62284e97897e5cd229153714e1b5))