Skip to content

OpenApiPrimitive Write for OpenApiString does not take into account IsExplicit #527

@WillGunn

Description

@WillGunn

case PrimitiveType.String:
var stringValue = (OpenApiString)(IOpenApiPrimitive)this;
writer.WriteValue(stringValue.Value);
break;

Currently there is no way to write a raw string value without json encoding it as the writer does not take into account the IsExplicit value stored in OpenApiString. This feels like a bug, if so an easy fix would be to check if OpenApiString.IsExplicit() is true then call WriteRaw instead of WriteValue. If this would cause backwards compatibility issues, I suggest adding another parameter to OpenApiString that allows its contents to be called with WriteRaw instead of WriteValue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions