IOpenApiExample Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines the base properties for the example object. This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
public interface IOpenApiExample : Microsoft.OpenApi.IOpenApiDescribedElement, Microsoft.OpenApi.IOpenApiReadOnlyExtensible, Microsoft.OpenApi.IOpenApiReferenceable, Microsoft.OpenApi.IOpenApiSummarizedElement, Microsoft.OpenApi.IShallowCopyable<Microsoft.OpenApi.IOpenApiExample>
type IOpenApiExample = interface
interface IOpenApiDescribedElement
interface IOpenApiElement
interface IOpenApiSummarizedElement
interface IOpenApiReadOnlyExtensible
interface IShallowCopyable<IOpenApiExample>
interface IOpenApiReferenceable
interface IOpenApiSerializable
Public Interface IOpenApiExample
Implements IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IOpenApiReferenceable, IOpenApiSummarizedElement, IShallowCopyable(Of IOpenApiExample)
- Derived
- Implements
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. (Inherited from IOpenApiDescribedElement) |
| Extensions |
Specification extensions. (Inherited from IOpenApiReadOnlyExtensible) |
| 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. |
| 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. (Inherited from IOpenApiSummarizedElement) |
| 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 |
|---|---|
| CreateShallowCopy() |
Create a shallow copy of the current instance. (Inherited from IShallowCopyable<T>) |
| SerializeAsV2(IOpenApiWriter) |
Serialize Open API element to v2.0. (Inherited from IOpenApiSerializable) |
| SerializeAsV3(IOpenApiWriter) |
Serialize Open API element to v3.0. (Inherited from IOpenApiSerializable) |
| SerializeAsV31(IOpenApiWriter) |
Serialize OpenAPI element into v3.1 (Inherited from IOpenApiSerializable) |
| SerializeAsV32(IOpenApiWriter) |
Serialize OpenAPI element into v3.2 (Inherited from IOpenApiSerializable) |
Extension Methods
| Name | Description |
|---|---|
| Validate(IOpenApiElement, ValidationRuleSet) |
Validate element and all child elements |