OpenApiExample Class

Definition

Example Object.

public class OpenApiExample : Microsoft.OpenApi.Interfaces.IEffective<Microsoft.OpenApi.Models.OpenApiExample>, Microsoft.OpenApi.Interfaces.IOpenApiExtensible, Microsoft.OpenApi.Interfaces.IOpenApiReferenceable
type OpenApiExample = class
    interface IOpenApiSerializable
    interface IOpenApiElement
    interface IOpenApiReferenceable
    interface IOpenApiExtensible
    interface IEffective<OpenApiExample>
Public Class OpenApiExample
Implements IEffective(Of OpenApiExample), IOpenApiExtensible, IOpenApiReferenceable
Inheritance
OpenApiExample
Implements

Constructors

OpenApiExample()

Parameter-less constructor

OpenApiExample(OpenApiExample)

Initializes a copy of OpenApiExample object

Properties

Description

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

Extensions

This object MAY be extended with 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.

Reference

Reference object.

Summary

Short description for the example.

UnresolvedReference

Indicates object is a placeholder reference to an actual object and does not contain valid data.

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.

Methods

GetEffective(OpenApiDocument)

Returns an effective OpenApiExample object based on the presence of a $ref

SerializeAsV2(IOpenApiWriter)

Serialize OpenApiExample to Open Api v2.0

SerializeAsV2WithoutReference(IOpenApiWriter)

Serialize to OpenAPI V2 document without using reference.

SerializeAsV3(IOpenApiWriter)

Serialize OpenApiExample to Open Api v3.0

SerializeAsV3WithoutReference(IOpenApiWriter)

Serialize to OpenAPI V3 document without using reference.

Extension Methods

Validate(IOpenApiElement, ValidationRuleSet)

Validate element and all child elements

ResolveReference(IOpenApiReferenceable, JsonPointer)

Resolves a JSON Pointer with respect to an element, returning the referenced element.

Applies to