mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-21 16:27:48 +01:00
* . * Use ILRepack to include Microsoft.OpenApi as internal * ... * OpenApiSpecificationVersion * . * 080 * 4
25 lines
812 B
C#
25 lines
812 B
C#
// Copyright © WireMock.Net
|
|
|
|
using System.Linq;
|
|
using RamlToOpenApiConverter;
|
|
using MicrosoftOpenApiDiagnostic = Microsoft.OpenApi.Reader.OpenApiDiagnostic;
|
|
|
|
namespace WireMock.Net.OpenApiParser.Models;
|
|
|
|
internal static class OpenApiMapper
|
|
{
|
|
internal static OpenApiDiagnostic? Map(MicrosoftOpenApiDiagnostic? openApiDiagnostic)
|
|
{
|
|
if (openApiDiagnostic == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return new OpenApiDiagnostic
|
|
{
|
|
Errors = openApiDiagnostic.Errors.Select(e => new OpenApiError(e.Pointer, e.Message)).ToList(),
|
|
Warnings = openApiDiagnostic.Warnings.Select(e => new OpenApiError(e.Pointer, e.Message)).ToList(),
|
|
SpecificationVersion = (OpenApiSpecificationVersion)openApiDiagnostic.SpecificationVersion
|
|
};
|
|
}
|
|
} |