Skip to content

ResolvedEndpoint

mattpolzin edited this page Jun 11, 2021 · 3 revisions

ResolvedEndpoint

The canonical definition of an endpoint. All information from throughout the OpenAPI document that is relevant to a particular endpoint is collected and exposed in this type.

public struct ResolvedEndpoint: Equatable 

You can access resolved endpoints via the ResolvedDocument type. You make a ResolvedDocument from an OpenAPI.Document by calling:

try document
    .locallyDereferenced()
    .resolved()

See ResolvedDocument for more information.

Inheritance

Equatable

Properties

routeSummary

The summary for the route that contains this endpoint.

public let routeSummary: String?

routeDescription

The description of the route that contains this endpoint.

public let routeDescription: String?

routeVendorExtensions

The OpenAPI Specification Extensions available on the route that contains this endpoint.

public let routeVendorExtensions: [String: AnyCodable]

tags

The tags that are applicable to this endpoint.

public let tags: [String]

endpointSummary

The summary for the operation this endpoint performs.

public let endpointSummary: String?

endpointDescription

The description of the operation this endpoint performs.

public let endpointDescription: String?

endpointVendorExtensions

The OpenAPI Specification Extensions available on this endpoint.

public let endpointVendorExtensions: [String: AnyCodable]

operationId

The unique Id for the operation this endpoint performs.

public let operationId: String?

externalDocs

Any external documentation for this endpoint.

public let externalDocs: OpenAPI.ExternalDocumentation?

servers

Servers applicable to this endpoint.

public let servers: [OpenAPI.Server]

method

The HTTP method of this endpoint.

public let method: OpenAPI.HttpMethod

e.g. GET, POST, PUT, PATCH, etc.

path

The path for this endpoint.

public let path: OpenAPI.Path

parameters

The parameters this endpoint accepts.

public let parameters: [DereferencedParameter]

This array includes both parameters that apply to all endpoints at the same route and also parameters that only apply to this endpoint. It is comprehensive.

security

Security requirements for this endpoint.

public let security: [DereferencedSecurityRequirement]

An empty array means there are no requirements. If the array contains more than one entry, each entry is an alternative security requirement.

By contrast, each security requirement can itself contain any number of schemes and all schemes specified are required for each request ot this endpoint.

requestBody

The request body (if applicable) for this endpoint.

public let requestBody: DereferencedRequest?

responses

All possible responses, keyed by the status code for each response.

public let responses: DereferencedResponse.Map

deprecated

Indicates whether this endpoint should be used anymore or not.

public let deprecated: Bool

requiredParameters

Get only the parameters that are required.

public var requiredParameters: [DereferencedParameter] 

optionalParameters

Get only the parameters that are optional.

public var optionalParameters: [DereferencedParameter] 

responseOutcomes

Get all response outcomes for this endpoint.

public var responseOutcomes: [DereferencedOperation.ResponseOutcome] 

Returns

An array of ResponseOutcomes with the status and the response for the status.

Types
Protocols
Global Functions
Extensions
Clone this wiki locally