Skip to content

ResolvedRoute

mattpolzin edited this page Jun 11, 2021 · 3 revisions

ResolvedRoute

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

public struct ResolvedRoute: Equatable 

You can access resolved routes 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

summary

The summary of this route.

public let summary: String?

description

The description of this route.

public let description: String?

vendorExtensions

The OpenAPI Specification Extensions available on this route.

public let vendorExtensions: [String :AnyCodable]

path

The path at which this route is exposed.

public let path: OpenAPI.Path

parameters

All parameters that apply to all endpoints at this route. This array does not include parameters that apply to some but not all endpoints.

public let parameters: [DereferencedParameter]

For a comprehensive array of parameters relevant to any particular endpoint, use the ResolvedEndpoint parameters property. That property will contain both parameters that are relevant to all endpoints at this route and also parameters only relevant to the given endpoint.

servers

The list of servers that support this route.

public let servers: [OpenAPI.Server]

get

The HTTP GET endpoint at this route.

public let get: ResolvedEndpoint?

put

The HTTP PUT endpoint at this route.

public let put: ResolvedEndpoint?

post

The HTTP POST endpoint at this route.

public let post: ResolvedEndpoint?

delete

The HTTP DELETE endpoint at this route.

public let delete: ResolvedEndpoint?

options

The HTTP OPTIONS endpoint at this route.

public let options: ResolvedEndpoint?

head

The HTTP HEAD endpoint at this route.

public let head: ResolvedEndpoint?

patch

The HTTP PATCH endpoint at this route.

public let patch: ResolvedEndpoint?

trace

The HTTP TRACE endpoint at this route.

public let trace: ResolvedEndpoint?

endpoints

An array of all endpoints at this route.

public var endpoints: [ResolvedEndpoint] 

Methods

`for`(_:)

Retrieve the endpoint for the given method, if one exists for this route.

public func `for`(_ verb: OpenAPI.HttpMethod) -> ResolvedEndpoint? 
Types
Protocols
Global Functions
Extensions
Clone this wiki locally