Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System.IO;
using System.Threading.Tasks;
using Microsoft.OpenApi.Reader;
using Xunit;

namespace Microsoft.OpenApi.Readers.Tests.V32Tests
{
[Collection("DefaultSettings")]
public class OpenApiEncodingTests
{
private const string SampleFolderPath = "V32Tests/Samples/OpenApiEncoding/";

[Fact]
public async Task ParseEncodingWithAllowReservedShouldSucceed()
{
// Act
var encoding = await OpenApiModelFactory.LoadAsync<OpenApiEncoding>(Path.Combine(SampleFolderPath, "encodingWithAllowReserved.yaml"), OpenApiSpecVersion.OpenApi3_2, new(), SettingsFixture.ReaderSettings);

// Assert
Assert.Equivalent(
new OpenApiEncoding
{
ContentType = "application/x-www-form-urlencoded",
Style = ParameterStyle.Form,
Explode = true,
AllowReserved = true
}, encoding);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#encodingObject
contentType: application/x-www-form-urlencoded
style: form
explode: true
allowReserved: true