Evaluation.OpenAPI
0.1.3-pre-f4831be4
See the version list below for details.
dotnet add package Evaluation.OpenAPI --version 0.1.3-pre-f4831be4
NuGet\Install-Package Evaluation.OpenAPI -Version 0.1.3-pre-f4831be4
<PackageReference Include="Evaluation.OpenAPI" Version="0.1.3-pre-f4831be4" />
<PackageVersion Include="Evaluation.OpenAPI" Version="0.1.3-pre-f4831be4" />
<PackageReference Include="Evaluation.OpenAPI" />
paket add Evaluation.OpenAPI --version 0.1.3-pre-f4831be4
#r "nuget: Evaluation.OpenAPI, 0.1.3-pre-f4831be4"
#:package Evaluation.OpenAPI@0.1.3-pre-f4831be4
#addin nuget:?package=Evaluation.OpenAPI&version=0.1.3-pre-f4831be4&prerelease
#tool nuget:?package=Evaluation.OpenAPI&version=0.1.3-pre-f4831be4&prerelease
OpenAPI.Evaluation
Evaluates API requests and responses against OpenAPI 3.1 specifications using a custom System.Net.Http.DelegatingHandler.
Installation
dotnet add package OpenAPI.Evaluation
https://www.nuget.org/packages/OpenAPI.Evaluation/
Getting Started
Load the OpenAPI specification and create a HttpClient.
var stream = File.OpenRead("path/to/openapi-specification.json");
var document = JsonNode.Parse(stream);
var specification = Specification.OpenAPI.Parse(document);
var evaluationOptions = new EvaluationOptions();
var client = new HttpClient(
new EvaluationHandler(
specification,
evaluationOptions,
new HttpClientHandler()));
When sending a request the HttpResponseMessage will be wrapped by a EvaluationHttpResponseMessage that contains the evaluation results in the property EvaluationResults.
If the HttpRequestMessage fails evaluation the handler will return a EvaluationHttpResponseMessage with a BadRequest response and never send the request to the server.
If you rather prefer failed evaluations to throw and exception, this is configurable in the EvaluationOptions.
Yaml
To load a yaml formatted specification, I recommend Yaml2JsonNode.
var yaml = new YamlStream();
using var reader = File.OpenText("path/to/openapi-specification.yaml");
yaml.Load(reader);
var document = yaml.ToJsonNode().First();
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
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. 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. 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. |
-
net7.0
- JsonSchema.Net (>= 5.0.0 && < 6.0.0)
- JsonSchema.Net.OpenApi (>= 2.0.0 && <= 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Evaluation.OpenAPI:
| Package | Downloads |
|---|---|
|
AspNet.Evaluation.OpenAPI
Integrates OpenAPI Evaluation into ASP.NET |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 235 | 4/2/2025 |
| 1.0.0-pre-a7a98715 | 157 | 2/26/2025 |
| 0.2.1 | 625 | 11/14/2023 |
| 0.2.1-pre-f49ec224 | 163 | 11/3/2023 |
| 0.2.1-pre-ea6a9e96 | 161 | 11/3/2023 |
| 0.2.1-pre-a33f16eb | 166 | 11/13/2023 |
| 0.2.0 | 200 | 10/21/2023 |
| 0.2.0-pre-647143b8 | 173 | 10/21/2023 |
| 0.1.4 | 326 | 10/20/2023 |
| 0.1.4-pre-ec87d5f0 | 185 | 10/20/2023 |
| 0.1.3 | 198 | 10/20/2023 |
| 0.1.3-pre-f4831be4 | 296 | 10/18/2023 |
| 0.1.3-pre-b1017338 | 164 | 9/25/2023 |
| 0.1.3-pre-ac8a2be1 | 170 | 10/5/2023 |
| 0.1.3-pre-aaf91f75 | 161 | 10/19/2023 |
| 0.1.3-pre-a9418932 | 184 | 9/29/2023 |
| 0.1.3-pre-8dc1b144 | 164 | 10/5/2023 |
| 0.1.3-pre-883cad79 | 180 | 9/11/2023 |
| 0.1.3-pre-7c961d85 | 176 | 9/12/2023 |
| 0.1.3-pre-5719591c | 183 | 10/7/2023 |
| 0.1.3-pre-4e3f9171 | 192 | 9/12/2023 |
| 0.1.3-pre-44b42e86 | 158 | 9/19/2023 |
| 0.1.3-pre-384196a7 | 174 | 9/12/2023 |
| 0.1.3-pre-29a8a676 | 170 | 10/6/2023 |
| 0.1.3-pre-1a9e6d11 | 169 | 9/11/2023 |
| 0.1.3-pre-08176b8b | 179 | 9/13/2023 |
| 0.1.2 | 221 | 9/6/2023 |
## [v0.1.3-pre-f4831be4](https://github.com/Fresa/OpenAPI.Evaluation/compare/a3edfdd59983903d0c6bac0bc94a8e0f4d191dba...f4831be4e3c2804479e7d1c7fd63a7a6d121b597) (2023-10-18)