Skip to content

Commit

Permalink
2.17.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dankinsoid committed Jun 11, 2023
1 parent d561e80 commit c05e38f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import PackageDescription
let package = Package(
name: "SomeProject",
dependencies: [
.package(url: "https://github.com/dankinsoid/SwiftOpenAPI.git", from: "2.17.6")
.package(url: "https://github.com/dankinsoid/SwiftOpenAPI.git", from: "2.17.7")
],
targets: [
.target(name: "SomeProject", dependencies: ["SwiftOpenAPI"])
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftOpenAPI/Objects/OperationObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public struct OperationObject: Equatable, Codable, SpecificationExtendable {
public var operationId: String?

/// A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.
public var parameters: Parameters?
public var parameters: ParametersList?

/// The request body applicable for this operation. The requestBody is fully supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody is permitted but does not have well-defined semantics and SHOULD be avoided if possible.
public var requestBody: ReferenceOr<RequestBodyObject>?
Expand All @@ -41,7 +41,7 @@ public struct OperationObject: Equatable, Codable, SpecificationExtendable {

public var specificationExtensions: SpecificationExtensions? = nil

public init(tags: [String]? = nil, summary: String? = nil, description: String, externalDocs: ExternalDocumentationObject? = nil, operationId: String? = nil, parameters: Parameters? = nil, requestBody: ReferenceOr<RequestBodyObject>? = nil, responses: ResponsesObject? = nil, callbacks: [String: ReferenceOr<CallbackObject>]? = nil, deprecated: Bool? = nil, security: [SecurityRequirementObject]? = nil, servers: [ServerObject]? = nil) {
public init(tags: [String]? = nil, summary: String? = nil, description: String, externalDocs: ExternalDocumentationObject? = nil, operationId: String? = nil, parameters: ParametersList? = nil, requestBody: ReferenceOr<RequestBodyObject>? = nil, responses: ResponsesObject? = nil, callbacks: [String: ReferenceOr<CallbackObject>]? = nil, deprecated: Bool? = nil, security: [SecurityRequirementObject]? = nil, servers: [ServerObject]? = nil) {
self.tags = tags
self.summary = summary
self.description = description
Expand Down
10 changes: 5 additions & 5 deletions Sources/SwiftOpenAPI/Objects/ParameterObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation
/// There are four possible parameter locations specified by the in field:
///
/// - `path` - Used together with Path Templating, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in /items/{itemId}, the path parameter is itemId.
/// - `query` - Parameters that are appended to the URL. For example, in /items?id=###, the query parameter is id.
/// - `query` - ParametersList that are appended to the URL. For example, in /items?id=###, the query parameter is id.
/// - `header` - Custom headers that are expected as part of the request. Note that RFC7230 states header names are case insensitive.
/// - `cookie` - Used to pass a specific cookie value to the API.
public struct ParameterObject: Codable, Equatable, SpecificationExtendable {
Expand Down Expand Up @@ -91,17 +91,17 @@ public extension ParameterObject {
}
}

public typealias Parameters = [ReferenceOr<ParameterObject>]
public typealias ParametersList = [ReferenceOr<ParameterObject>]

public extension Parameters {
public extension ParametersList {

static func encode(
_ value: Encodable,
in location: ParameterObject.Location,
dateFormat: DateEncodingFormat = .default,
keyEncodingStrategy: KeyEncodingStrategy = .default,
schemas: inout ComponentsMap<SchemaObject>
) throws -> Parameters {
) throws -> ParametersList {
try ParametersEncoder(location: location, dateFormat: dateFormat, keyEncodingStrategy: keyEncodingStrategy)
.encode(value, schemas: &schemas)
.map {
Expand All @@ -115,7 +115,7 @@ public extension Parameters {
dateFormat: DateEncodingFormat = .default,
keyEncodingStrategy: KeyEncodingStrategy = .default,
schemas: inout ComponentsMap<SchemaObject>
) throws -> Parameters {
) throws -> ParametersList {
try ParametersEncoder(location: location, dateFormat: dateFormat, keyEncodingStrategy: keyEncodingStrategy)
.decode(type, schemas: &schemas)
.map {
Expand Down
22 changes: 11 additions & 11 deletions Sources/SwiftOpenAPI/Objects/PathItemObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public struct PathItemObject: Codable, Equatable, SpecificationExtendable {
public var servers: [ServerObject]?

/// A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.
public var parameters: Parameters?
public var parameters: ParametersList?

public var specificationExtensions: SpecificationExtensions? = nil

public init(
summary: String? = nil,
description: String? = nil,
servers: [ServerObject]? = nil,
parameters: Parameters? = nil,
parameters: ParametersList? = nil,
_ operations: [PathItemObject.Key: OperationObject]
) {
self.summary = summary
Expand All @@ -38,7 +38,7 @@ public struct PathItemObject: Codable, Equatable, SpecificationExtendable {
summary = try container.decodeIfPresent(String.self, forKey: .field(.summary))
description = try container.decodeIfPresent(String.self, forKey: .field(.description))
servers = try container.decodeIfPresent([ServerObject].self, forKey: .field(.servers))
parameters = try container.decodeIfPresent(Parameters.self, forKey: .field(.parameters))
parameters = try container.decodeIfPresent(ParametersList.self, forKey: .field(.parameters))
operations = [:]
// specificationExtensions = try SpecificationExtensions(from: decoder)

Expand Down Expand Up @@ -181,7 +181,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.get: operation]))
Expand All @@ -192,7 +192,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.put: operation]))
Expand All @@ -203,7 +203,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.post: operation]))
Expand All @@ -214,7 +214,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.delete: operation]))
Expand All @@ -225,7 +225,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.options: operation]))
Expand All @@ -236,7 +236,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.head: operation]))
Expand All @@ -247,7 +247,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.patch: operation]))
Expand All @@ -258,7 +258,7 @@ public extension ExpressibleByPathItemObject {
summary: String? = nil,
description: String? = nil,
servers: [ServerObject] = [],
parameters: Parameters = [],
parameters: ParametersList = [],
_ operation: OperationObject
) -> Self {
Self(pathItemObject: PathItemObject(summary: summary, description: description, servers: servers, parameters: parameters, [.trace: operation]))
Expand Down
2 changes: 1 addition & 1 deletion SwiftOpenAPI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SwiftOpenAPI'
s.version = '2.17.6'
s.version = '2.17.7'
s.summary = 'A short description of SwiftOpenAPI.'
s.description = <<-DESC
TODO: Add long description of the pod here.
Expand Down

0 comments on commit c05e38f

Please sign in to comment.