-
Notifications
You must be signed in to change notification settings - Fork 39
OpenAPI_PathItem
OpenAPI Spec "Path Item Object"
public struct PathItem: Equatable, CodableVendorExtendable
In addition to parameters that apply to all endpoints under the current path, this type offers access to each possible endpoint operation under properties named after the operation.
The GET
operation, for example, is accessed via the .get
property. You can
also use the subscript operator, passing it the HTTPMethod
you want to access.
You can access an array of equatable HttpMethod
/Operation
paris with the
endpoints
property.
CodableVendorExtendable
, Decodable
, Encodable
, Equatable
, LocallyDereferenceable
public typealias Map = OrderedDictionary<OpenAPI.Path, OpenAPI.PathItem>
init(summary:description:servers:parameters:get:put:post:delete:options:head:patch:trace:vendorExtensions:)
public init(
summary: String? = nil,
description: String? = nil,
servers: [OpenAPI.Server]? = nil,
parameters: Parameter.Array = [],
get: Operation? = nil,
put: Operation? = nil,
post: Operation? = nil,
delete: Operation? = nil,
options: Operation? = nil,
head: Operation? = nil,
patch: Operation? = nil,
trace: Operation? = nil,
vendorExtensions: [String: AnyCodable] = [:]
)
public init(from decoder: Decoder) throws
public var summary: String?
public var description: String?
public var servers: [OpenAPI.Server]?
Parameters that apply to all operations at this path. See the parameters
on each Operation
for a complete picture of a given endpoint's
parameters.
public var parameters: Parameter.Array
A Parameter.Array
is an array of "either parameter or
reference to parameter" entries. You can use the lookup(_:)
method on the OpenAPI.Components
found at
document.components
to resolve one of these entries to
an OpenAPI.Parameter
.
The GET
endpoint at this path, if one exists.
public var get: Operation?
The PUT
endpoint at this path, if one exists.
public var put: Operation?
The POST
endpoint at this path, if one exists.
public var post: Operation?
The DELETE
endpoint at this path, if one exists.
public var delete: Operation?
The OPTIONS
endpoint at this path, if one exists.
public var options: Operation?
The HEAD
endpoint at this path, if one exists.
public var head: Operation?
The PATCH
endpoint at this path, if one exists.
public var patch: Operation?
The TRACE
endpoint at this path, if one exists.
public var trace: Operation?
Dictionary of vendor extensions.
public var vendorExtensions: [String: AnyCodable]
These should be of the form:
[ "x-extensionKey": <anything>]
where the values are anything codable.
Get all endpoints defined at this path.
public var endpoints: [Endpoint]
An array of Endpoints
with the method (i.e. .get
) and the operation for the method.
An internal-use method that facilitates reference cycle detection by tracking past references followed in the course of dereferencing.
public func _dereferenced(
in components: OpenAPI.Components,
following references: Set<AnyHashable>,
dereferencedFromComponentNamed name: String?
) throws -> DereferencedPathItem
For all external-use, see dereferenced(in:)
(provided by the LocallyDereferenceable
protocol).
All types that provide a _dereferenced(in:following:)
implementation have a dereferenced(in:)
implementation for free.
Set the GET
endpoint operation.
public mutating func get(_ op: Operation?)
Set the PUT
endpoint operation.
public mutating func put(_ op: Operation?)
Set the POST
endpoint operation.
public mutating func post(_ op: Operation?)
Set the DELETE
endpoint operation.
public mutating func delete(_ op: Operation?)
Set the OPTIONS
endpoint operation.
public mutating func options(_ op: Operation?)
Set the HEAD
endpoint operation.
public mutating func head(_ op: Operation?)
Set the PATCH
endpoint operation.
public mutating func patch(_ op: Operation?)
Set the TRACE
endpoint operation.
public mutating func trace(_ op: Operation?)
Retrieve the operation for the given verb, if one is set for this path.
public func `for`(_ verb: OpenAPI.HttpMethod) -> OpenAPI.Operation?
Set the operation for the given verb, overwriting any already set operation for the same verb.
public mutating func set(operation: OpenAPI.Operation?, for verb: OpenAPI.HttpMethod)
public func encode(to encoder: Encoder) throws
.
Types
- AnyCodable
- DereferencedContent
- DereferencedContentEncoding
- DereferencedDocument
- DereferencedDocument.Route
- DereferencedHeader
- DereferencedJSONSchema
- DereferencedJSONSchema.ArrayContext
- DereferencedJSONSchema.ObjectContext
- DereferencedOperation
- DereferencedOperation.ResponseOutcome
- DereferencedParameter
- DereferencedPathItem
- DereferencedPathItem.Endpoint
- DereferencedRequest
- DereferencedResponse
- DereferencedSchemaContext
- DereferencedSecurityRequirement
- DereferencedSecurityRequirement.ScopedScheme
- Either
- EitherDecodeNoTypesMatchedError
- EitherDecodeNoTypesMatchedError.IndividualFailure
- ErrorCategory
- ErrorCategory.KeyValue
- InconsistencyError
- JSONReference
- JSONReference.InternalReference
- JSONReference.Path
- JSONReference.PathComponent
- JSONSchema
- JSONSchema.ArrayContext
- JSONSchema.CoreContext
- JSONSchema.CoreContext.Permissions
- JSONSchema.IntegerContext
- JSONSchema.IntegerContext.Bound
- JSONSchema.NumericContext
- JSONSchema.NumericContext.Bound
- JSONSchema.ObjectContext
- JSONSchema.StringContext
- JSONSchemaResolutionError
- JSONType
- JSONTypeFormat
- JSONTypeFormat.AnyFormat
- JSONTypeFormat.ArrayFormat
- JSONTypeFormat.BooleanFormat
- JSONTypeFormat.IntegerFormat
- JSONTypeFormat.IntegerFormat.Extended
- JSONTypeFormat.NumberFormat
- JSONTypeFormat.ObjectFormat
- JSONTypeFormat.StringFormat
- JSONTypeFormat.StringFormat.Extended
- OpenAPI
- OpenAPI.CallbackURL
- OpenAPI.ComponentKey
- OpenAPI.Components
- OpenAPI.Components.ReferenceCycleError
- OpenAPI.Components.ReferenceError
- OpenAPI.Content
- OpenAPI.Content.Encoding
- OpenAPI.ContentType
- OpenAPI.Discriminator
- OpenAPI.Document
- OpenAPI.Document.Info
- OpenAPI.Document.Info.Contact
- OpenAPI.Document.Info.License
- OpenAPI.Document.Route
- OpenAPI.Document.Version
- OpenAPI.Error
- OpenAPI.Error.Decoding
- OpenAPI.Error.Decoding.Document
- OpenAPI.Error.Decoding.Document.Context
- OpenAPI.Error.Decoding.Operation
- OpenAPI.Error.Decoding.Operation.Context
- OpenAPI.Error.Decoding.Path
- OpenAPI.Error.Decoding.Path.Context
- OpenAPI.Error.Decoding.Request
- OpenAPI.Error.Decoding.Request.Context
- OpenAPI.Error.Decoding.Response
- OpenAPI.Error.Decoding.Response.Context
- OpenAPI.Example
- OpenAPI.ExternalDocumentation
- OpenAPI.Header
- OpenAPI.HttpMethod
- OpenAPI.Link
- OpenAPI.OAuthFlows
- OpenAPI.OAuthFlows.AuthorizationCode
- OpenAPI.OAuthFlows.ClientCredentials
- OpenAPI.OAuthFlows.CommonFields
- OpenAPI.OAuthFlows.Implicit
- OpenAPI.OAuthFlows.Password
- OpenAPI.Operation
- OpenAPI.Operation.ResponseOutcome
- OpenAPI.Parameter
- OpenAPI.Parameter.Context
- OpenAPI.Parameter.Context.Location
- OpenAPI.Parameter.SchemaContext
- OpenAPI.Parameter.SchemaContext.Style
- OpenAPI.Path
- OpenAPI.PathItem
- OpenAPI.PathItem.Endpoint
- OpenAPI.Request
- OpenAPI.Response
- OpenAPI.Response.StatusCode
- OpenAPI.Response.StatusCode.Range
- OpenAPI.RuntimeExpression
- OpenAPI.RuntimeExpression.Source
- OpenAPI.SecurityScheme
- OpenAPI.SecurityScheme.Location
- OpenAPI.SecurityScheme.SecurityType
- OpenAPI.SecurityScheme.SecurityType.Name
- OpenAPI.Server
- OpenAPI.Server.Variable
- OpenAPI.Tag
- OpenAPI.XML
- OrderedDictionary
- OrderedDictionary.Iterator
- ResolvedDocument
- ResolvedEndpoint
- ResolvedRoute
- URLTemplate
- URLTemplate.Component
- Validation
- ValidationContext
- ValidationError
- ValidationErrorCollection
- Validator
- Validator.CodingKey
Protocols
Global Functions
Extensions
- Array
- Bool
- Dictionary
- Double
- Float
- Int
- Int32
- Int64
- OpenAPI.Callbacks
- OpenAPI.Content.Encoding
- OpenAPI.Document.Info
- OpenAPI.Document.Info.Contact
- OpenAPI.Document.Info.License
- OpenAPI.Error.Decoding
- OpenAPI.Error.Decoding.Document
- OpenAPI.Error.Decoding.Operation
- OpenAPI.Error.Decoding.Path
- OpenAPI.Error.Decoding.Request
- OpenAPI.Error.Decoding.Response
- OpenAPI.OAuthFlows.AuthorizationCode
- OpenAPI.OAuthFlows.ClientCredentials
- OpenAPI.OAuthFlows.CommonFields
- OpenAPI.OAuthFlows.Implicit
- OpenAPI.OAuthFlows.Password
- OpenAPI.Parameter.Context
- OpenAPI.Parameter.SchemaContext
- OpenAPI.Response.StatusCode
- OpenAPI.Server.Variable
- Optional
- String
- URL
- UUID