private static void WritePropertyInternal <T>(this IOpenApiWriter writer, string name, T element) { CheckArgument(writer, name); writer.WritePropertyName(name); writer.WriteValueInternal(element); }
private static void WriteCollectionInternal <T>(this IOpenApiWriter writer, string name, IEnumerable <T> elements) { CheckArgument(writer, name); writer.WritePropertyName(name); writer.WriteStartArray(); if (elements != null) { foreach (T e in elements) { writer.WriteValueInternal(e); } } writer.WriteEndArray(); }
private static void WriteDictionaryInternal <T>(this IOpenApiWriter writer, string name, IDictionary <string, T> elements) { CheckArgument(writer, name); writer.WritePropertyName(name); writer.WriteStartObject(); if (elements != null) { foreach (KeyValuePair <string, T> e in elements) { writer.WritePropertyName(e.Key); writer.WriteValueInternal(e.Value); } } writer.WriteEndObject(); }