/// <summary> /// convert the key/value schema info data to string /// </summary> /// <param name="kvSchemaInfo"> the key/value schema info </param> /// <returns> the convert schema info data string </returns> public static string ConvertKeyValueSchemaInfoDataToString(KeyValue<ISchemaInfo, ISchemaInfo> kvSchemaInfo) { var keyValue = new KeyValue<object, object>(SchemaType.IsPrimitiveType(kvSchemaInfo.Key.Type) ? "" : JsonSerializer.Serialize(kvSchemaInfo.Key.Schema), SchemaType.IsPrimitiveType(kvSchemaInfo.Value.Type) ? "" : JsonSerializer.Serialize(kvSchemaInfo.Value.Schema)); return JsonSerializer.Serialize(keyValue); }
/// <summary> /// Jsonify the key/value schema info. /// </summary> /// <param name="kvSchemaInfo"> the key/value schema info </param> /// <returns> the jsonified schema info </returns> public static string JsonifyKeyValueSchemaInfo(KeyValue<ISchemaInfo, ISchemaInfo> kvSchemaInfo) { return JsonSerializer.Serialize(kvSchemaInfo); }