Share via


OpenApiServer Class

Definition

Server Object: an object representing a Server.

public class OpenApiServer : Microsoft.OpenApi.IOpenApiExtensible, Microsoft.OpenApi.IOpenApiSerializable
type OpenApiServer = class
    interface IOpenApiSerializable
    interface IOpenApiElement
    interface IOpenApiExtensible
Public Class OpenApiServer
Implements IOpenApiExtensible, IOpenApiSerializable
Inheritance
OpenApiServer
Implements

Constructors

Name Description
OpenApiServer()

Parameterless constructor

OpenApiServer(OpenApiServer)

Initializes a copy of an OpenApiServer object

Properties

Name Description
Description

An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.

Extensions

This object MAY be extended with Specification Extensions.

Name

An optional string identifying the server. This MUST be unique across servers in the same document. Note: This field is supported in OpenAPI 3.2.0+. For earlier versions, it will be serialized as x-oai-name extension.

Url

REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in {brackets}.

Variables

A map between a variable name and its value. The value is used for substitution in the server's URL template.

Methods

Name Description
SerializeAsV2(IOpenApiWriter)

Serialize OpenApiServer to Open Api v2.0

SerializeAsV3(IOpenApiWriter)

Serialize OpenApiServer to Open Api v3.0

SerializeAsV31(IOpenApiWriter)

Serialize OpenApiServer to Open Api v3.1

SerializeAsV32(IOpenApiWriter)

Serialize OpenApiServer to Open Api v3.2

Extension Methods

Name Description
ReplaceServerUrlVariables(OpenApiServer, Dictionary<String,String>)

Replaces URL variables in a server's URL

Validate(IOpenApiElement, ValidationRuleSet)

Validate element and all child elements

Applies to