diff --git a/Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs b/Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs index c5de6ec68..15555f416 100644 --- a/Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs +++ b/Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs @@ -408,6 +408,7 @@ public void PushStructure(string fieldName) if (!string.IsNullOrEmpty(fieldName)) { EscapeString(fieldName); + m_writer.Write(s_quotationColon); } else if (!m_commaRequired) { @@ -435,6 +436,7 @@ public void PushArray(string fieldName) if (!string.IsNullOrEmpty(fieldName)) { EscapeString(fieldName); + m_writer.Write(s_quotationColon); } else if (!m_commaRequired) { @@ -630,8 +632,6 @@ private void EscapeString(ReadOnlySpan value) { WriteSpan(ref lastOffset, value, value.Length); } - - m_writer.Write(s_quotationColon); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -686,7 +686,6 @@ private void EscapeString(string value) m_writer.Write(ch); } } - m_writer.Write(s_quotationColon); } #endif @@ -720,6 +719,7 @@ private void WriteSimpleField(string fieldName, string value) } EscapeString(fieldName); + m_writer.Write(s_quotationColon); } else { @@ -759,12 +759,12 @@ private void WriteSimpleField(string fieldName, string value, EscapeOptions opti { m_writer.Write(s_quotation); m_writer.Write(fieldName); - m_writer.Write(s_quotationColon); } else { EscapeString(fieldName); } + m_writer.Write(s_quotationColon); } else { @@ -782,12 +782,12 @@ private void WriteSimpleField(string fieldName, string value, EscapeOptions opti { m_writer.Write(s_quotation); m_writer.Write(value); - m_writer.Write(s_quotation); } else { EscapeString(value); } + m_writer.Write(s_quotation); } else { @@ -1418,6 +1418,7 @@ public void WriteVariant(string fieldName, Variant value) if (!string.IsNullOrEmpty(fieldName)) { EscapeString(fieldName); + m_writer.Write(s_quotationColon); } WriteVariantContents(value.Value, value.TypeInfo); @@ -2697,12 +2698,12 @@ private void PushStructure(string fieldName, EscapeOptions escapeOptions = Escap { m_writer.Write(s_quotation); m_writer.Write(fieldName); - m_writer.Write(s_quotationColon); } else { EscapeString(fieldName); } + m_writer.Write(s_quotationColon); } else if (!m_commaRequired) {