File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/Microsoft.OpenApi.YamlReader Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using System . Globalization ;
44using System . Linq ;
5+ using System . Text . Json ;
56using System . Text . Json . Nodes ;
67using SharpYaml ;
78using SharpYaml . Serialization ;
@@ -135,7 +136,8 @@ private static YamlScalarNode ToYamlScalar(this JsonValue val)
135136 {
136137 // Try to get the underlying value based on its actual type
137138 // First try to get it as a string
138- if ( val . TryGetValue ( out string ? stringValue ) )
139+ if ( val . GetValueKind ( ) == JsonValueKind . String &&
140+ val . TryGetValue ( out string ? stringValue ) )
139141 {
140142 // For string values, we need to determine if they should be quoted in YAML
141143 // Strings that look like numbers, booleans, or null need to be quoted
You can’t perform that action at this time.
0 commit comments