Share via


OpenApiExampleReference Class

Definition

Example Object Reference.

public class OpenApiExampleReference : Microsoft.OpenApi.BaseOpenApiReferenceHolder<Microsoft.OpenApi.OpenApiExample,Microsoft.OpenApi.IOpenApiExample,Microsoft.OpenApi.OpenApiReferenceWithDescriptionAndSummary>, Microsoft.OpenApi.IOpenApiExample, Microsoft.OpenApi.IShallowCopyable<Microsoft.OpenApi.IOpenApiExample>
type OpenApiExampleReference = class
    inherit BaseOpenApiReferenceHolder<OpenApiExample, IOpenApiExample, OpenApiReferenceWithDescriptionAndSummary>
    interface IOpenApiExample
    interface IOpenApiDescribedElement
    interface IOpenApiElement
    interface IOpenApiSummarizedElement
    interface IOpenApiReadOnlyExtensible
    interface IShallowCopyable<IOpenApiExample>
    interface IOpenApiReferenceable
    interface IOpenApiSerializable
Public Class OpenApiExampleReference
Inherits BaseOpenApiReferenceHolder(Of OpenApiExample, IOpenApiExample, OpenApiReferenceWithDescriptionAndSummary)
Implements IOpenApiExample, IShallowCopyable(Of IOpenApiExample)
Inheritance
Implements

Constructors

Name Description
OpenApiExampleReference(String, OpenApiDocument, String)

Constructor initializing the reference object.

Properties

Name Description
DataValue

Embedded literal example value. The dataValue property and the value property are mutually exclusive. To represent examples of media types that cannot be naturally represented in JSON or YAML, use a string value to contain the example with escaping where necessary. Available in OpenAPI 3.2+, serialized as extension in 3.1 and earlier.

Description

Long description for the example. CommonMark syntax MAY be used for rich text representation.

Extensions

Specification extensions.

ExternalValue

A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive.

RecursiveTarget

Gets the recursively resolved target object.

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
Reference

Reference object.

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
SerializedValue

A string representation of the example. This is mutually exclusive with the value and dataValue properties. Available in OpenAPI 3.2+, serialized as extension in 3.1 and earlier.

Summary

Short description for the example.

Target

Gets the resolved target object.

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
UnresolvedReference

Indicates if object is populated with data or is just a reference to the data

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
Value

Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary. You must use the IsJsonNullSentinel(JsonNode) method to check whether Default was assigned a null value in the document. Assign JsonNull to use get null as a serialized value.

Methods

Name Description
CopyReference(OpenApiReferenceWithDescriptionAndSummary)

Copy the reference as a target element with overrides.

CopyReference(V)

Copy the reference as a target element with overrides.

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
CopyReferenceAsTargetElementWithOverrides(IOpenApiExample)

Copy the reference as a target element with overrides.

CopyReferenceAsTargetElementWithOverrides(U)

Copy the reference as a target element with overrides.

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
CreateShallowCopy()

Create a shallow copy of the current instance.

SerializeAsV2(IOpenApiWriter)

Serialize Open API element to v2.0.

SerializeAsV3(IOpenApiWriter)

Serialize Open API element to v3.0.

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
SerializeAsV31(IOpenApiWriter)

Serialize OpenAPI element into v3.1

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)
SerializeAsV32(IOpenApiWriter)

Serialize OpenAPI element into v3.2

(Inherited from BaseOpenApiReferenceHolder<T,U,V>)

Extension Methods

Name Description
Validate(IOpenApiElement, ValidationRuleSet)

Validate element and all child elements

Applies to