OpenApiWriterBase Class

Definition

Base class for Open API writer.

public abstract class OpenApiWriterBase : Microsoft.OpenApi.Writers.IOpenApiWriter
type OpenApiWriterBase = class
    interface IOpenApiWriter
Public MustInherit Class OpenApiWriterBase
Implements IOpenApiWriter
Inheritance
OpenApiWriterBase
Derived
Implements

Constructors

OpenApiWriterBase(TextWriter)

Initializes a new instance of the OpenApiWriterBase class.

OpenApiWriterBase(TextWriter, OpenApiWriterSettings)

Initializes a new instance of the OpenApiWriterBase class.

Fields

IndentationString

The indentation string to prepand to each line for each indentation level.

Scopes

Scope of the Open API element - object, array, property.

Properties

BaseIndentation

Base Indentation Level. This denotes how many indentations are needed for the property in the base object.

Settings

Settings for controlling how the OpenAPI document will be written out.

Writer

The text writer.

Methods

CurrentScope()

Get current scope.

DecreaseIndentation()

Decreases the level of indentation applied to the output.

EndScope(ScopeType)

End the scope of the given scope type.

Flush()

Flush the writer.

IncreaseIndentation()

Increases the level of indentation applied to the output.

IsArrayScope()

Whether the current scope is an array scope.

IsObjectScope()

Whether the current scope is an object scope.

IsTopLevelScope()

Whether the current scope is the top level (outermost) scope.

StartScope(ScopeType)

Start the scope given the scope type.

VerifyCanWritePropertyName(String)

Verifies whether a property name can be written based on whether the property name is a valid string and whether the current scope is an object scope.

WriteEndArray()

Write end array.

WriteEndObject()

Write end object.

WriteIndentation()

Write the indentation.

WriteNull()

Write null value.

WritePropertyName(String)

Write the start property.

WriteRaw(String)

Write content raw value.

WriteStartArray()

Write start array.

WriteStartObject()

Write start object.

WriteValue(Boolean)

Write boolean value.

WriteValue(DateTime)

Write DateTime value.

WriteValue(DateTimeOffset)

Write DateTimeOffset value.

WriteValue(Decimal)

Write decimal value.

WriteValue(Double)

Write double value.

WriteValue(Int32)

Write integer value.

WriteValue(Int64)

Write long value.

WriteValue(Object)

Write object value.

WriteValue(Single)

Write float value.

WriteValue(String)

Write string value.

WriteValueSeparator()

Writes a separator of a value if it's needed for the next value to be written.

Extension Methods

WriteAny<T>(IOpenApiWriter, T)

Write the IOpenApiAny value.

WriteExtensions(IOpenApiWriter, IDictionary<String,IOpenApiExtension>, OpenApiSpecVersion)

Write the specification extensions

WriteOptionalCollection(IOpenApiWriter, String, IEnumerable<String>, Action<IOpenApiWriter,String>)

Write the optional of collection string.

WriteOptionalCollection<T>(IOpenApiWriter, String, IEnumerable<T>, Action<IOpenApiWriter,T>)

Write the optional Open API object/element collection.

WriteOptionalMap(IOpenApiWriter, String, IDictionary<String,String>, Action<IOpenApiWriter,String>)

Write the optional Open API element map (string to string mapping).

WriteOptionalMap<T>(IOpenApiWriter, String, IDictionary<String,T>, Action<IOpenApiWriter,T>)

Write the optional Open API element map.

WriteOptionalMap<T>(IOpenApiWriter, String, IDictionary<String,T>, Action<IOpenApiWriter,String,T>)

Write the optional Open API element map.

WriteOptionalObject<T>(IOpenApiWriter, String, T, Action<IOpenApiWriter,T>)

Write the optional Open API object/element.

WriteProperty(IOpenApiWriter, String, Boolean, Boolean)

Write a boolean property.

WriteProperty(IOpenApiWriter, String, Nullable<Boolean>, Boolean)

Write a boolean property.

WriteProperty(IOpenApiWriter, String, String)

Write a string property.

WriteProperty<T>(IOpenApiWriter, String, T)

Write a string/number property.

WriteProperty<T>(IOpenApiWriter, String, Nullable<T>)

Write a primitive property.

WriteRequiredCollection<T>(IOpenApiWriter, String, IEnumerable<T>, Action<IOpenApiWriter,T>)

Write the required Open API object/element collection.

WriteRequiredMap(IOpenApiWriter, String, IDictionary<String,String>, Action<IOpenApiWriter,String>)

Write the required Open API element map (string to string mapping).

WriteRequiredMap<T>(IOpenApiWriter, String, IDictionary<String,T>, Action<IOpenApiWriter,T>)

Write the required Open API element map.

WriteRequiredObject<T>(IOpenApiWriter, String, T, Action<IOpenApiWriter,T>)

Write the required Open API object/element.

WriteRequiredProperty(IOpenApiWriter, String, String)

Write required string property.

Applies to