/// <summary>
 /// Write the required Open API object/element collection.
 /// </summary>
 /// <typeparam name="T">The Open API element type. <see cref="IOpenApiElement"/></typeparam>
 /// <param name="writer">The Open API writer.</param>
 /// <param name="name">The property name.</param>
 /// <param name="elements">The collection values.</param>
 /// <param name="action">The collection element writer action.</param>
 public static void WriteRequiredCollection <T>(
     this IOpenApiWriter writer,
     string name,
     IEnumerable <T> elements,
     Action <IOpenApiWriter, T> action)
     where T : IOpenApiElement
 {
     writer.WriteCollectionInternal(name, elements, action);
 }
        /// <summary>
        /// Write the collection of Open API element optional.
        /// </summary>
        /// <param name="writer">The Open API writer.</param>
        /// <param name="name">The property name.</param>
        /// <param name="elements">The collection of Open API element.</param>
        public static void WriteOptionalCollection(this IOpenApiWriter writer, string name, IEnumerable <IOpenApiWritable> elements)
        {
            if (elements == null)
            {
                return;
            }

            writer.WriteCollectionInternal(name, elements);
        }
 /// <summary>
 /// Write the optional of collection string.
 /// </summary>
 /// <param name="writer">The Open API writer.</param>
 /// <param name="name">The property name.</param>
 /// <param name="elements">The collection values.</param>
 /// <param name="action">The collection string writer action.</param>
 public static void WriteOptionalCollection(
     this IOpenApiWriter writer,
     string name,
     IEnumerable <string> elements,
     Action <IOpenApiWriter, string> action)
 {
     if (elements != null && elements.Any())
     {
         writer.WriteCollectionInternal(name, elements, action);
     }
 }
Пример #4
0
 /// <summary>
 /// Write the optional Open API object/element collection.
 /// </summary>
 /// <typeparam name="T">The Open API element type. <see cref="IOpenApiElement"/></typeparam>
 /// <param name="writer">The Open API writer.</param>
 /// <param name="name">The property name.</param>
 /// <param name="elements">The collection values.</param>
 /// <param name="action">The collection element writer action.</param>
 public static void WriteOptionalCollection <T>(
     this IOpenApiWriter writer,
     string name,
     IList <T> elements,
     Action <IOpenApiWriter, T> action)
     where T : IOpenApiElement
 {
     if (elements != null && elements.Any())
     {
         writer.WriteCollectionInternal(name, elements, action);
     }
 }
 /// <summary>
 /// Write the collection of Open API element.
 /// </summary>
 /// <param name="writer">The Open API writer.</param>
 /// <param name="name">The property name.</param>
 /// <param name="elements">The collection of Open API element.</param>
 public static void WriteRequiredCollection(this IOpenApiWriter writer, string name, IEnumerable <IOpenApiWritable> elements)
 {
     writer.WriteCollectionInternal(name, elements);
 }