You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Microsoft.OpenApi.Readers 1.4.1 always gives the property Style of a parameter a value.
I think it is the default value. So the information is lost that 'style' was not set in the original file.
Microsoft.OpenApi.Readers 1.3.2 works as expected. OpenApiParameter.Style has the value null.
Eventually it is an effect of resolving the bug #858
To Reproduce
Use the following code to read 'readFile' and write 'writeFile'.
Open the two files in a compare tool.
Code:
using var stream = new FileStream(readFile, FileMode.Open);
var doc =
new OpenApiStreamReader(
new OpenApiReaderSettings
{
ReferenceResolution = ReferenceResolutionSetting.DoNotResolveReferences
})
.Read(stream, out _);
var sb = new StringBuilder();
var writer = new OpenApiYamlWriter(new StringWriter(sb, new CultureInfo("en_us")));
doc.SerializeAsV3(writer);
File.WriteAllText(writeFile, sb.ToString());
Activity
richardkaspar commentedon Oct 26, 2022
Setting Style to null has no effect. So it is imposible to write a OpenAPI file with a parameter without 'style'.

darrelmiller commentedon Nov 22, 2022
Thanks for reporting this. I agree this should be fixed.