From 2b920d17f7b7a354810fff3f37d349ed4deaf952 Mon Sep 17 00:00:00 2001 From: Lucien Doellinger Date: Fri, 2 Sep 2022 18:40:55 -0300 Subject: [PATCH 1/3] Implement optional SecurityRequirements in Operations --- Sources/SwagGenKit/CodeFormatter.swift | 1 + Sources/Swagger/Operation.swift | 13 ++++++++- .../Security/SecurityRequirement.swift | 29 +++++++++++++++++-- Specs/Petstore/spec.yml | 6 +++- Templates/Swift/Sources/APIService.swift | 4 ++- Templates/Swift/Sources/Request.swift | 2 +- Tests/SwaggerTests/SpecTests.swift | 12 ++++++++ 7 files changed, 61 insertions(+), 6 deletions(-) diff --git a/Sources/SwagGenKit/CodeFormatter.swift b/Sources/SwagGenKit/CodeFormatter.swift index 141d04b91..29e971b46 100644 --- a/Sources/SwagGenKit/CodeFormatter.swift +++ b/Sources/SwagGenKit/CodeFormatter.swift @@ -380,6 +380,7 @@ public class CodeFormatter { var context: Context = [:] context["name"] = securityRequirement.name + context["isRequired"] = securityRequirement.isRequired context["scopes"] = securityRequirement.scopes context["scope"] = securityRequirement.scopes.first diff --git a/Sources/Swagger/Operation.swift b/Sources/Swagger/Operation.swift index 290683a20..93e76e056 100644 --- a/Sources/Swagger/Operation.swift +++ b/Sources/Swagger/Operation.swift @@ -57,7 +57,7 @@ extension Operation { identifier = jsonDictionary.json(atKeyPath: "operationId") tags = (jsonDictionary.json(atKeyPath: "tags")) ?? [] - securityRequirements = jsonDictionary.json(atKeyPath: "security") + securityRequirements = type(of: self).getSecurityRequirements(from: jsonDictionary) let allResponses: [String: PossibleReference] = try jsonDictionary.json(atKeyPath: "responses") var mappedResponses: [OperationResponse] = [] @@ -88,4 +88,15 @@ extension Operation { deprecated = (jsonDictionary.json(atKeyPath: "deprecated")) ?? false } + + private static func getSecurityRequirements( + from jsonDictionary: JSONDictionary + ) -> [SecurityRequirement]? { + guard let securityRequirements: [SecurityRequirement] = + jsonDictionary.json(atKeyPath: "security") else { + return nil + } + + return securityRequirements.updatingRequiredFlag() + } } diff --git a/Sources/Swagger/Security/SecurityRequirement.swift b/Sources/Swagger/Security/SecurityRequirement.swift index e4c713549..ee3898b5f 100644 --- a/Sources/Swagger/Security/SecurityRequirement.swift +++ b/Sources/Swagger/Security/SecurityRequirement.swift @@ -1,12 +1,37 @@ import Foundation import JSONUtilities -public struct SecurityRequirement: JSONObjectConvertible { +public struct SecurityRequirement: Equatable { public let name: String + public let isRequired: Bool public let scopes: [String] + public static let optionalMarker: SecurityRequirement = { + .init(name: "optional-marker", isRequired: false, scopes: []) + }() +} + +extension SecurityRequirement: JSONObjectConvertible { public init(jsonDictionary: JSONDictionary) throws { - name = jsonDictionary.keys.first! + guard let firstKey = jsonDictionary.keys.first else { + self = .optionalMarker + return + } + name = firstKey + isRequired = true scopes = try jsonDictionary.json(atKeyPath: .key(name)) } } + +extension Array where Element == SecurityRequirement { + func updatingRequiredFlag() -> [Element] { + // Check if there is an optional security requirement marker + guard (contains(where: { $0 == .optionalMarker })) else { + return self + } + // Remove the optional marker and set all security requirements as optional + return self + .drop { $0 == .optionalMarker } + .map { .init(name: $0.name, isRequired: false, scopes: $0.scopes) } + } +} diff --git a/Specs/Petstore/spec.yml b/Specs/Petstore/spec.yml index 19989e851..59d17f65b 100644 --- a/Specs/Petstore/spec.yml +++ b/Specs/Petstore/spec.yml @@ -54,6 +54,10 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" + security: + - {} + - petstore_auth: + - read:pets post: summary: Create a pet operationId: createPets @@ -174,4 +178,4 @@ components: type: integer format: int32 message: - type: string \ No newline at end of file + type: string diff --git a/Templates/Swift/Sources/APIService.swift b/Templates/Swift/Sources/APIService.swift index 3f46743d5..16d0d0c8f 100644 --- a/Templates/Swift/Sources/APIService.swift +++ b/Templates/Swift/Sources/APIService.swift @@ -34,10 +34,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Templates/Swift/Sources/Request.swift b/Templates/Swift/Sources/Request.swift index 848d926a3..4b10b4f91 100644 --- a/Templates/Swift/Sources/Request.swift +++ b/Templates/Swift/Sources/Request.swift @@ -24,7 +24,7 @@ extension {{ options.name }}{% if tag %}.{{ options.tagPrefix }}{{ tag|upperCame {% endif %} public enum {{ type }} { - public static let service = APIService(id: "{{ operationId }}", tag: "{{ tag }}", method: "{{ method|uppercase }}", path: "{{ path }}", hasBody: {% if hasBody %}true{% else %}false{% endif %}{% if isUpload %}, isUpload: true{% endif %}, securityRequirements: [{% for securityRequirement in securityRequirements %}SecurityRequirement(type: "{{ securityRequirement.name }}", scopes: [{% for scope in securityRequirement.scopes %}"{{ scope }}"{% ifnot forloop.last %}, {% endif %}{% endfor %}]){% ifnot forloop.last %}, {% endif %}{% endfor %}]) + public static let service = APIService(id: "{{ operationId }}", tag: "{{ tag }}", method: "{{ method|uppercase }}", path: "{{ path }}", hasBody: {% if hasBody %}true{% else %}false{% endif %}{% if isUpload %}, isUpload: true{% endif %}, securityRequirements: [{% for securityRequirement in securityRequirements %}SecurityRequirement(type: "{{ securityRequirement.name }}", isRequired: {% if securityRequirement.isRequired %}true{% else %}false{% endif %}, scopes: [{% for scope in securityRequirement.scopes %}"{{ scope }}"{% ifnot forloop.last %}, {% endif %}{% endfor %}]){% ifnot forloop.last %}, {% endif %}{% endfor %}]) {% for enum in requestEnums %} {% if not enum.isGlobal %} diff --git a/Tests/SwaggerTests/SpecTests.swift b/Tests/SwaggerTests/SpecTests.swift index 23ae06cbb..28065cad9 100644 --- a/Tests/SwaggerTests/SpecTests.swift +++ b/Tests/SwaggerTests/SpecTests.swift @@ -81,6 +81,11 @@ class SpecTests: XCTestCase { $0.it("has a default responses") { try expect(operation?.defaultResponse?.value.description) == "unexpected error" } + $0.it("has 1 optional security requirement") { + try expect(operation?.securityRequirements?.count) == 1 + try expect(operation?.securityRequirements?.contains(where: { $0 == .optionalMarker })) == false + try expect(operation?.securityRequirements?.first?.isRequired) == false + } } } @@ -159,6 +164,13 @@ class SpecTests: XCTestCase { $0.it("is a post operation") { try expect(operation?.method) == .post } + $0.it("has 1 non-optional security requirement") { + try expect(operation?.securityRequirements?.count) == 1 + let securityRequirement = operation?.securityRequirements?.first + try expect(securityRequirement?.name) == "petstore_auth" + try expect(securityRequirement?.isRequired) == true + try expect(securityRequirement?.scopes) == ["write:pets", "read:pets"] + } } } From b8eaa82ab83e03cc2f8eca438840e844bf17db90 Mon Sep 17 00:00:00 2001 From: Lucien Doellinger Date: Fri, 2 Sep 2022 18:34:58 -0300 Subject: [PATCH 2/3] Supports top-level Security Requirements inheritance and overriding --- Sources/Swagger/Operation.swift | 18 +++++++--- Sources/Swagger/Path.swift | 11 +++++-- Sources/Swagger/SwaggerSpec.swift | 33 ++++++++++++++++--- Specs/Petstore/spec.yml | 7 ++-- Tests/SwaggerTests/SpecTests.swift | 53 ++++++++++++++++++++++++------ 5 files changed, 98 insertions(+), 24 deletions(-) diff --git a/Sources/Swagger/Operation.swift b/Sources/Swagger/Operation.swift index 93e76e056..0dcbc6013 100644 --- a/Sources/Swagger/Operation.swift +++ b/Sources/Swagger/Operation.swift @@ -41,7 +41,11 @@ public struct Operation { extension Operation { - public init(path: String, method: Method, pathParameters: [PossibleReference], jsonDictionary: JSONDictionary) throws { + public init(path: String, + method: Method, + pathParameters: [PossibleReference], + jsonDictionary: JSONDictionary, + topLevelSecurityRequirements: [SecurityRequirement]?) throws { json = jsonDictionary self.path = path self.method = method @@ -57,7 +61,10 @@ extension Operation { identifier = jsonDictionary.json(atKeyPath: "operationId") tags = (jsonDictionary.json(atKeyPath: "tags")) ?? [] - securityRequirements = type(of: self).getSecurityRequirements(from: jsonDictionary) + securityRequirements = type(of: self).getSecurityRequirements( + from: jsonDictionary, + topLevelSecurityRequirements: topLevelSecurityRequirements + ) let allResponses: [String: PossibleReference] = try jsonDictionary.json(atKeyPath: "responses") var mappedResponses: [OperationResponse] = [] @@ -90,11 +97,14 @@ extension Operation { } private static func getSecurityRequirements( - from jsonDictionary: JSONDictionary + from jsonDictionary: JSONDictionary, + topLevelSecurityRequirements: [SecurityRequirement]? ) -> [SecurityRequirement]? { + // Even an empty list of operation security requirements + // can remove top-level security requirements. guard let securityRequirements: [SecurityRequirement] = jsonDictionary.json(atKeyPath: "security") else { - return nil + return topLevelSecurityRequirements } return securityRequirements.updatingRequiredFlag() diff --git a/Sources/Swagger/Path.swift b/Sources/Swagger/Path.swift index 3f17d193a..a34042b12 100644 --- a/Sources/Swagger/Path.swift +++ b/Sources/Swagger/Path.swift @@ -9,7 +9,9 @@ public struct Path { extension Path: NamedMappable { - public init(name: String, jsonDictionary: JSONDictionary) throws { + public init(name: String, + jsonDictionary: JSONDictionary, + topLevelSecurityRequirements: [SecurityRequirement]?) throws { path = name parameters = (jsonDictionary.json(atKeyPath: "parameters")) ?? [] @@ -17,7 +19,12 @@ extension Path: NamedMappable { for (key, value) in jsonDictionary { if let method = Operation.Method(rawValue: key) { if let json = value as? [String: Any] { - let operation = try Operation(path: path, method: method, pathParameters: parameters, jsonDictionary: json) + let operation = try Operation( + path: path, + method: method, + pathParameters: parameters, + jsonDictionary: json, + topLevelSecurityRequirements: topLevelSecurityRequirements) mappedOperations.append(operation) } } diff --git a/Sources/Swagger/SwaggerSpec.swift b/Sources/Swagger/SwaggerSpec.swift index 77ee1d39d..706e355f4 100644 --- a/Sources/Swagger/SwaggerSpec.swift +++ b/Sources/Swagger/SwaggerSpec.swift @@ -30,7 +30,9 @@ public enum TransferScheme: String { } public protocol NamedMappable { - init(name: String, jsonDictionary: JSONDictionary) throws + init(name: String, + jsonDictionary: JSONDictionary, + topLevelSecurityRequirements: [SecurityRequirement]?) throws } extension SwaggerSpec { @@ -69,12 +71,20 @@ extension SwaggerSpec: JSONObjectConvertible { public init(jsonDictionary: JSONDictionary) throws { - func decodeNamed(jsonDictionary: JSONDictionary, key: String) throws -> [T] { + func decodeNamed( + jsonDictionary: JSONDictionary, + key: String, + topLevelSecurityRequirements: [SecurityRequirement]? + ) throws -> [T] { var values: [T] = [] if let dictionary = jsonDictionary[key] as? [String: Any] { for (key, value) in dictionary { if let dictionary = value as? [String: Any] { - let value = try T(name: key, jsonDictionary: dictionary) + let value = try T( + name: key, + jsonDictionary: dictionary, + topLevelSecurityRequirements: topLevelSecurityRequirements + ) values.append(value) } } @@ -91,13 +101,15 @@ extension SwaggerSpec: JSONObjectConvertible { info = try jsonDictionary.json(atKeyPath: "info") servers = jsonDictionary.json(atKeyPath: "servers") ?? [] - securityRequirements = jsonDictionary.json(atKeyPath: "security") + securityRequirements = type(of: self).getSecurityRequirements(from: jsonDictionary) if jsonDictionary["components"] != nil { components = try jsonDictionary.json(atKeyPath: "components") } else { components = Components() } - paths = try decodeNamed(jsonDictionary: jsonDictionary, key: "paths") + paths = try decodeNamed(jsonDictionary: jsonDictionary, + key: "paths", + topLevelSecurityRequirements: securityRequirements) operations = paths.reduce([]) { $0 + $1.operations } .sorted(by: { (lhs, rhs) -> Bool in if lhs.path == rhs.path { @@ -109,4 +121,15 @@ extension SwaggerSpec: JSONObjectConvertible { let resolver = ComponentResolver(spec: self) resolver.resolve() } + + private static func getSecurityRequirements( + from jsonDictionary: JSONDictionary + ) -> [SecurityRequirement]? { + guard let securityRequirements: [SecurityRequirement] = + jsonDictionary.json(atKeyPath: "security") else { + return nil + } + + return securityRequirements.updatingRequiredFlag() + } } diff --git a/Specs/Petstore/spec.yml b/Specs/Petstore/spec.yml index 59d17f65b..fe3799d19 100644 --- a/Specs/Petstore/spec.yml +++ b/Specs/Petstore/spec.yml @@ -19,6 +19,9 @@ servers: - x-name: Prod description: Prod environment url: http://petstore.swagger.io/v1 +security: + - petstore_auth: + - read:pets paths: /pets: get: @@ -133,9 +136,7 @@ paths: "405": description: Invalid input security: - - petstore_auth: - - write:pets - - read:pets + - [] components: securitySchemes: petstore_auth: diff --git a/Tests/SwaggerTests/SpecTests.swift b/Tests/SwaggerTests/SpecTests.swift index 28065cad9..08d8d0796 100644 --- a/Tests/SwaggerTests/SpecTests.swift +++ b/Tests/SwaggerTests/SpecTests.swift @@ -9,7 +9,7 @@ class SpecTests: XCTestCase { func testSpecs() { describe("petstore spec") { - let path = Path(#file) + "../../../Specs/petstore/spec.yml" + let path = Path(#file) + "../../../Specs/Petstore/spec.yml" $0.it("can load") { _ = try SwaggerSpec(path: Path(path.string)) @@ -82,9 +82,33 @@ class SpecTests: XCTestCase { try expect(operation?.defaultResponse?.value.description) == "unexpected error" } $0.it("has 1 optional security requirement") { - try expect(operation?.securityRequirements?.count) == 1 - try expect(operation?.securityRequirements?.contains(where: { $0 == .optionalMarker })) == false - try expect(operation?.securityRequirements?.first?.isRequired) == false + let securityRequirements = try XCTUnwrap(operation?.securityRequirements) + try expect(securityRequirements.count) == 1 + try expect(securityRequirements.contains( + where: { $0 == .optionalMarker }) + ) == false + + let securityRequirement = try XCTUnwrap(securityRequirements.first) + try expect(securityRequirement.isRequired) == false + try expect(securityRequirement.name) == "petstore_auth" + try expect(securityRequirement.scopes) == ["read:pets"] + } + } + + $0.describe("Create a pet operation") { + + let operation = path?.operations.filter { $0.identifier == "createPets" }.first + $0.it("has get operation id") { + try expect(operation?.identifier) == "createPets" + } + $0.it("has 1 required security requirement") { + let securityRequirements = try XCTUnwrap(operation?.securityRequirements) + try expect(securityRequirements.count) == 1 + + let securityRequirement = try XCTUnwrap(securityRequirements.first) + try expect(securityRequirement.isRequired) == true + try expect(securityRequirement.name) == "petstore_auth" + try expect(securityRequirement.scopes) == ["write:pets", "read:pets"] } } } @@ -129,6 +153,10 @@ class SpecTests: XCTestCase { $0.it("is a get operation") { try expect(operation?.method) == .get } + $0.it("has top-level security requirements") { + XCTAssertEqual(operation?.securityRequirements, + spec.securityRequirements) + } } $0.it("has a updatePetWithForm operation") { @@ -164,12 +192,8 @@ class SpecTests: XCTestCase { $0.it("is a post operation") { try expect(operation?.method) == .post } - $0.it("has 1 non-optional security requirement") { - try expect(operation?.securityRequirements?.count) == 1 - let securityRequirement = operation?.securityRequirements?.first - try expect(securityRequirement?.name) == "petstore_auth" - try expect(securityRequirement?.isRequired) == true - try expect(securityRequirement?.scopes) == ["write:pets", "read:pets"] + $0.it("has no security requirements") { + try expect(operation?.securityRequirements?.isEmpty) == true } } } @@ -191,6 +215,15 @@ class SpecTests: XCTestCase { try expect(petDefinition?.name) == "Pet" } + $0.it("has top-level security requirements") { + let securityRequirements = try XCTUnwrap(spec.securityRequirements) + try expect(securityRequirements.count) == 1 + let securityRequirement = try XCTUnwrap(securityRequirements.first) + try expect(securityRequirement.isRequired) == true + try expect(securityRequirement.name) == "petstore_auth" + try expect(securityRequirement.scopes) == ["read:pets"] + } + $0.it("has tags") { try expect(spec.tags.count) == 1 } From 3782fe9185444ba3948c6699f34b90bad14d7c9a Mon Sep 17 00:00:00 2001 From: Lucien Doellinger Date: Fri, 2 Sep 2022 18:43:37 -0300 Subject: [PATCH 3/3] Update generated specs --- Specs/Petstore/generated/Swift/Sources/APIService.swift | 4 +++- .../generated/Swift/Sources/Requests/Pets/CreatePets.swift | 2 +- .../generated/Swift/Sources/Requests/Pets/ListPets.swift | 2 +- .../generated/Swift/Sources/Requests/Pets/ShowPetById.swift | 2 +- .../Swift/Sources/Requests/Pets/UpdatePetWithForm.swift | 2 +- Specs/PetstoreTest/generated/Swift/Sources/APIService.swift | 4 +++- .../Swift/Sources/Requests/Fake/TestEndpointParameters.swift | 2 +- .../generated/Swift/Sources/Requests/Pet/AddPet.swift | 2 +- .../generated/Swift/Sources/Requests/Pet/DeletePet.swift | 2 +- .../Swift/Sources/Requests/Pet/FindPetsByStatus.swift | 2 +- .../generated/Swift/Sources/Requests/Pet/FindPetsByTags.swift | 2 +- .../generated/Swift/Sources/Requests/Pet/GetPetById.swift | 2 +- .../generated/Swift/Sources/Requests/Pet/UpdatePet.swift | 2 +- .../Swift/Sources/Requests/Pet/UpdatePetWithForm.swift | 2 +- .../generated/Swift/Sources/Requests/Pet/UploadFile.swift | 2 +- .../generated/Swift/Sources/Requests/Store/GetInventory.swift | 2 +- Specs/Rocket/generated/Swift/Sources/APIService.swift | 4 +++- .../Swift/Sources/Requests/Account/ChangePassword.swift | 2 +- .../generated/Swift/Sources/Requests/Account/ChangePin.swift | 2 +- .../Swift/Sources/Requests/Account/CreateProfile.swift | 2 +- .../Swift/Sources/Requests/Account/DeleteProfileWithId.swift | 2 +- .../Swift/Sources/Requests/Account/DeregisterDevice.swift | 2 +- .../generated/Swift/Sources/Requests/Account/GetAccount.swift | 2 +- .../generated/Swift/Sources/Requests/Account/GetDevice.swift | 2 +- .../generated/Swift/Sources/Requests/Account/GetDevices.swift | 2 +- .../Swift/Sources/Requests/Account/GetEntitlements.swift | 2 +- .../Swift/Sources/Requests/Account/GetItemMediaFiles.swift | 2 +- .../Sources/Requests/Account/GetItemMediaFilesGuarded.swift | 2 +- .../Swift/Sources/Requests/Account/GetProfileWithId.swift | 2 +- .../Swift/Sources/Requests/Account/RegisterDevice.swift | 2 +- .../Swift/Sources/Requests/Account/RenameDevice.swift | 2 +- .../Sources/Requests/Account/RequestEmailVerification.swift | 2 +- .../Swift/Sources/Requests/Account/UpdateAccount.swift | 2 +- .../Swift/Sources/Requests/Account/UpdateProfileWithId.swift | 2 +- .../Sources/Requests/Authorization/GetProfileToken.swift | 2 +- .../Swift/Sources/Requests/Profile/BookmarkItem.swift | 2 +- .../Swift/Sources/Requests/Profile/DeleteItemBookmark.swift | 2 +- .../Swift/Sources/Requests/Profile/GetBookmarkList.swift | 2 +- .../Swift/Sources/Requests/Profile/GetBookmarks.swift | 2 +- .../Swift/Sources/Requests/Profile/GetItemBookmark.swift | 2 +- .../Swift/Sources/Requests/Profile/GetItemRating.swift | 2 +- .../Swift/Sources/Requests/Profile/GetItemWatchedStatus.swift | 2 +- .../generated/Swift/Sources/Requests/Profile/GetProfile.swift | 2 +- .../generated/Swift/Sources/Requests/Profile/GetRatings.swift | 2 +- .../Swift/Sources/Requests/Profile/GetRatingsList.swift | 2 +- .../generated/Swift/Sources/Requests/Profile/GetWatched.swift | 2 +- .../Swift/Sources/Requests/Profile/GetWatchedList.swift | 2 +- .../generated/Swift/Sources/Requests/Profile/RateItem.swift | 2 +- .../Swift/Sources/Requests/Profile/SetItemWatchedStatus.swift | 2 +- .../Swift/Sources/Requests/Support/ResetPassword.swift | 2 +- .../Swift/Sources/Requests/Support/VerifyEmail.swift | 2 +- Specs/TBX/generated/Swift/Sources/APIService.swift | 4 +++- Specs/TFL/generated/Swift/Sources/APIService.swift | 4 +++- Specs/TestSpec/generated/Swift/Sources/APIService.swift | 4 +++- .../generated/Swift/Sources/Requests/GetDefaultResponse.swift | 2 +- Specs/TestSpec/generated/Swift/Sources/Requests/GetFile.swift | 2 +- .../Swift/Sources/Requests/GetInlineEnumResponse.swift | 2 +- .../generated/Swift/Sources/Requests/GetMultipleParams.swift | 2 +- .../generated/Swift/Sources/Requests/GetMultipleSuccess.swift | 2 +- .../TestSpec/generated/Swift/Sources/Requests/GetString.swift | 2 +- Specs/TestSpec/generated/Swift/Sources/Requests/Pets.swift | 2 +- .../generated/Swift/Sources/Requests/PostAllParams.swift | 2 +- .../generated/Swift/Sources/Requests/PostInlinebody.swift | 2 +- .../generated/Swift/Sources/Requests/PostString.swift | 2 +- .../generated/Swift/Sources/Requests/UpdateWithForm.swift | 2 +- 65 files changed, 77 insertions(+), 65 deletions(-) diff --git a/Specs/Petstore/generated/Swift/Sources/APIService.swift b/Specs/Petstore/generated/Swift/Sources/APIService.swift index 4cf2264f2..dc630b379 100644 --- a/Specs/Petstore/generated/Swift/Sources/APIService.swift +++ b/Specs/Petstore/generated/Swift/Sources/APIService.swift @@ -37,10 +37,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/CreatePets.swift b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/CreatePets.swift index caa3987a6..a670baf9f 100644 --- a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/CreatePets.swift +++ b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/CreatePets.swift @@ -10,7 +10,7 @@ extension Petstore.Pets { /** Create a pet */ public enum CreatePets { - public static let service = APIService(id: "createPets", tag: "pets", method: "POST", path: "/pets", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "createPets", tag: "pets", method: "POST", path: "/pets", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ListPets.swift b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ListPets.swift index 1775b2e14..b00db544a 100644 --- a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ListPets.swift +++ b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ListPets.swift @@ -10,7 +10,7 @@ extension Petstore.Pets { /** List all pets */ public enum ListPets { - public static let service = APIService(id: "listPets", tag: "pets", method: "GET", path: "/pets", hasBody: false, securityRequirements: []) + public static let service = APIService(id: "listPets", tag: "pets", method: "GET", path: "/pets", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: false, scopes: ["read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ShowPetById.swift b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ShowPetById.swift index 4e17c9e24..5c93e66a7 100644 --- a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ShowPetById.swift +++ b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/ShowPetById.swift @@ -10,7 +10,7 @@ extension Petstore.Pets { /** Info for a specific pet */ public enum ShowPetById { - public static let service = APIService(id: "showPetById", tag: "pets", method: "GET", path: "/pets/{petId}", hasBody: false, securityRequirements: []) + public static let service = APIService(id: "showPetById", tag: "pets", method: "GET", path: "/pets/{petId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/UpdatePetWithForm.swift b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/UpdatePetWithForm.swift index 936090cac..8b2a44bad 100644 --- a/Specs/Petstore/generated/Swift/Sources/Requests/Pets/UpdatePetWithForm.swift +++ b/Specs/Petstore/generated/Swift/Sources/Requests/Pets/UpdatePetWithForm.swift @@ -10,7 +10,7 @@ extension Petstore.Pets { /** Updates a pet in the store with form data */ public enum UpdatePetWithForm { - public static let service = APIService(id: "updatePetWithForm", tag: "pets", method: "POST", path: "/pets/{petId}", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "updatePetWithForm", tag: "pets", method: "POST", path: "/pets/{petId}", hasBody: true, securityRequirements: []) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/APIService.swift b/Specs/PetstoreTest/generated/Swift/Sources/APIService.swift index 4cf2264f2..dc630b379 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/APIService.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/APIService.swift @@ -37,10 +37,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Fake/TestEndpointParameters.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Fake/TestEndpointParameters.swift index 676781073..1fd226c6c 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Fake/TestEndpointParameters.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Fake/TestEndpointParameters.swift @@ -14,7 +14,7 @@ extension PetstoreTest.Fake { */ public enum TestEndpointParameters { - public static let service = APIService(id: "testEndpointParameters", tag: "fake", method: "POST", path: "/fake", hasBody: true, isUpload: true, securityRequirements: [SecurityRequirement(type: "http_basic_test", scopes: [])]) + public static let service = APIService(id: "testEndpointParameters", tag: "fake", method: "POST", path: "/fake", hasBody: true, isUpload: true, securityRequirements: [SecurityRequirement(type: "http_basic_test", isRequired: true, scopes: [])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/AddPet.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/AddPet.swift index 5930f85b9..7b57d439a 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/AddPet.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/AddPet.swift @@ -10,7 +10,7 @@ extension PetstoreTest.Pet { /** Add a new pet to the store */ public enum AddPet { - public static let service = APIService(id: "addPet", tag: "pet", method: "POST", path: "/pet", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "addPet", tag: "pet", method: "POST", path: "/pet", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/DeletePet.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/DeletePet.swift index 3ad58478c..50f5261f3 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/DeletePet.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/DeletePet.swift @@ -10,7 +10,7 @@ extension PetstoreTest.Pet { /** Deletes a pet */ public enum DeletePet { - public static let service = APIService(id: "deletePet", tag: "pet", method: "DELETE", path: "/pet/{petId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "deletePet", tag: "pet", method: "DELETE", path: "/pet/{petId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByStatus.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByStatus.swift index 738b1a480..dba192de3 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByStatus.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByStatus.swift @@ -14,7 +14,7 @@ extension PetstoreTest.Pet { */ public enum FindPetsByStatus { - public static let service = APIService(id: "findPetsByStatus", tag: "pet", method: "GET", path: "/pet/findByStatus", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "findPetsByStatus", tag: "pet", method: "GET", path: "/pet/findByStatus", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) /** Status values that need to be considered for filter */ public enum Status: String, Codable, Equatable, CaseIterable { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByTags.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByTags.swift index 0010695c3..f36288a87 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByTags.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/FindPetsByTags.swift @@ -14,7 +14,7 @@ extension PetstoreTest.Pet { */ public enum FindPetsByTags { - public static let service = APIService(id: "findPetsByTags", tag: "pet", method: "GET", path: "/pet/findByTags", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "findPetsByTags", tag: "pet", method: "GET", path: "/pet/findByTags", hasBody: false, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/GetPetById.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/GetPetById.swift index a52ce439f..c27e0c9e9 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/GetPetById.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/GetPetById.swift @@ -14,7 +14,7 @@ extension PetstoreTest.Pet { */ public enum GetPetById { - public static let service = APIService(id: "getPetById", tag: "pet", method: "GET", path: "/pet/{petId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "api_key", scopes: [])]) + public static let service = APIService(id: "getPetById", tag: "pet", method: "GET", path: "/pet/{petId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "api_key", isRequired: true, scopes: [])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePet.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePet.swift index 353a3c013..e3ba39430 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePet.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePet.swift @@ -10,7 +10,7 @@ extension PetstoreTest.Pet { /** Update an existing pet */ public enum UpdatePet { - public static let service = APIService(id: "updatePet", tag: "pet", method: "PUT", path: "/pet", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "updatePet", tag: "pet", method: "PUT", path: "/pet", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePetWithForm.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePetWithForm.swift index 087ca5488..ff60e5a74 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePetWithForm.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UpdatePetWithForm.swift @@ -10,7 +10,7 @@ extension PetstoreTest.Pet { /** Updates a pet in the store with form data */ public enum UpdatePetWithForm { - public static let service = APIService(id: "updatePetWithForm", tag: "pet", method: "POST", path: "/pet/{petId}", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "updatePetWithForm", tag: "pet", method: "POST", path: "/pet/{petId}", hasBody: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UploadFile.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UploadFile.swift index 859ac6dd0..854820456 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UploadFile.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Pet/UploadFile.swift @@ -10,7 +10,7 @@ extension PetstoreTest.Pet { /** uploads an image */ public enum UploadFile { - public static let service = APIService(id: "uploadFile", tag: "pet", method: "POST", path: "/pet/{petId}/uploadImage", hasBody: true, isUpload: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", scopes: ["write:pets", "read:pets"])]) + public static let service = APIService(id: "uploadFile", tag: "pet", method: "POST", path: "/pet/{petId}/uploadImage", hasBody: true, isUpload: true, securityRequirements: [SecurityRequirement(type: "petstore_auth", isRequired: true, scopes: ["write:pets", "read:pets"])]) public final class Request: APIRequest { diff --git a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Store/GetInventory.swift b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Store/GetInventory.swift index 10810cabb..702cc499e 100644 --- a/Specs/PetstoreTest/generated/Swift/Sources/Requests/Store/GetInventory.swift +++ b/Specs/PetstoreTest/generated/Swift/Sources/Requests/Store/GetInventory.swift @@ -14,7 +14,7 @@ extension PetstoreTest.Store { */ public enum GetInventory { - public static let service = APIService(id: "getInventory", tag: "store", method: "GET", path: "/store/inventory", hasBody: false, securityRequirements: [SecurityRequirement(type: "api_key", scopes: [])]) + public static let service = APIService(id: "getInventory", tag: "store", method: "GET", path: "/store/inventory", hasBody: false, securityRequirements: [SecurityRequirement(type: "api_key", isRequired: true, scopes: [])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/APIService.swift b/Specs/Rocket/generated/Swift/Sources/APIService.swift index 4cf2264f2..dc630b379 100644 --- a/Specs/Rocket/generated/Swift/Sources/APIService.swift +++ b/Specs/Rocket/generated/Swift/Sources/APIService.swift @@ -37,10 +37,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePassword.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePassword.swift index f01cee97a..709011dd3 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePassword.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePassword.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Change the password of an account. */ public enum ChangePassword { - public static let service = APIService(id: "changePassword", tag: "account", method: "PUT", path: "/account/password", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Settings"])]) + public static let service = APIService(id: "changePassword", tag: "account", method: "PUT", path: "/account/password", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Settings"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePin.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePin.swift index 8b57a04a5..17cc14655 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePin.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/ChangePin.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Change the pin of an account. */ public enum ChangePin { - public static let service = APIService(id: "changePin", tag: "account", method: "PUT", path: "/account/pin", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Settings"])]) + public static let service = APIService(id: "changePin", tag: "account", method: "PUT", path: "/account/pin", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Settings"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/CreateProfile.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/CreateProfile.swift index 888c3e0ca..73d399a32 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/CreateProfile.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/CreateProfile.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Create a new profile under the active account. */ public enum CreateProfile { - public static let service = APIService(id: "createProfile", tag: "account", method: "POST", path: "/account/profiles", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "createProfile", tag: "account", method: "POST", path: "/account/profiles", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeleteProfileWithId.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeleteProfileWithId.swift index 9908e9f59..879e077a8 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeleteProfileWithId.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeleteProfileWithId.swift @@ -12,7 +12,7 @@ Note that you cannot delete the primary profile. */ public enum DeleteProfileWithId { - public static let service = APIService(id: "deleteProfileWithId", tag: "account", method: "DELETE", path: "/account/profiles/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "deleteProfileWithId", tag: "account", method: "DELETE", path: "/account/profiles/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeregisterDevice.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeregisterDevice.swift index 630547494..ad03654ab 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeregisterDevice.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/DeregisterDevice.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Deregister a playback device from an account. */ public enum DeregisterDevice { - public static let service = APIService(id: "deregisterDevice", tag: "account", method: "DELETE", path: "/account/devices/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "deregisterDevice", tag: "account", method: "DELETE", path: "/account/devices/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetAccount.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetAccount.swift index 15ebb3639..885c5b870 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetAccount.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetAccount.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Get the details of an account along with the profiles and entitlements under it. */ public enum GetAccount { - public static let service = APIService(id: "getAccount", tag: "account", method: "GET", path: "/account", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getAccount", tag: "account", method: "GET", path: "/account", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevice.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevice.swift index 1a4f383b8..5ad183bab 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevice.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevice.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Get a registered device. */ public enum GetDevice { - public static let service = APIService(id: "getDevice", tag: "account", method: "GET", path: "/account/devices/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getDevice", tag: "account", method: "GET", path: "/account/devices/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevices.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevices.swift index 3ef1919f4..72a227d83 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevices.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetDevices.swift @@ -12,7 +12,7 @@ Also includes information around device registration and deregistration limits. */ public enum GetDevices { - public static let service = APIService(id: "getDevices", tag: "account", method: "GET", path: "/account/devices", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getDevices", tag: "account", method: "GET", path: "/account/devices", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetEntitlements.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetEntitlements.swift index c0808f890..82c90a189 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetEntitlements.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetEntitlements.swift @@ -13,7 +13,7 @@ only required when wishing to refresh a local copy of entitlements. */ public enum GetEntitlements { - public static let service = APIService(id: "getEntitlements", tag: "account", method: "GET", path: "/account/entitlements", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getEntitlements", tag: "account", method: "GET", path: "/account/entitlements", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFiles.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFiles.swift index 4c1b91c0f..e5f61fda6 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFiles.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFiles.swift @@ -29,7 +29,7 @@ If no files are found a 404 is returned. */ public enum GetItemMediaFiles { - public static let service = APIService(id: "getItemMediaFiles", tag: "account", method: "GET", path: "/account/items/{id}/videos", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getItemMediaFiles", tag: "account", method: "GET", path: "/account/items/{id}/videos", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFilesGuarded.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFilesGuarded.swift index b65989cc8..2bd1beffb 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFilesGuarded.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetItemMediaFilesGuarded.swift @@ -25,7 +25,7 @@ If no files are found a 404 is returned. */ public enum GetItemMediaFilesGuarded { - public static let service = APIService(id: "getItemMediaFilesGuarded", tag: "account", method: "GET", path: "/account/items/{id}/videos-guarded", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Playback"])]) + public static let service = APIService(id: "getItemMediaFilesGuarded", tag: "account", method: "GET", path: "/account/items/{id}/videos-guarded", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Playback"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetProfileWithId.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetProfileWithId.swift index f8d44c47a..a528acf27 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetProfileWithId.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/GetProfileWithId.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Get the summary of a profile with a specific id under the active account. */ public enum GetProfileWithId { - public static let service = APIService(id: "getProfileWithId", tag: "account", method: "GET", path: "/account/profiles/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getProfileWithId", tag: "account", method: "GET", path: "/account/profiles/{id}", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/RegisterDevice.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/RegisterDevice.swift index 4a345999e..35458fd8a 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/RegisterDevice.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/RegisterDevice.swift @@ -12,7 +12,7 @@ If a device with the same id already exists a `409` conflict will be returned. */ public enum RegisterDevice { - public static let service = APIService(id: "registerDevice", tag: "account", method: "POST", path: "/account/devices", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "registerDevice", tag: "account", method: "POST", path: "/account/devices", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/RenameDevice.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/RenameDevice.swift index cf824240d..fba9f0dd7 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/RenameDevice.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/RenameDevice.swift @@ -10,7 +10,7 @@ extension Rocket.Account { /** Rename a device */ public enum RenameDevice { - public static let service = APIService(id: "renameDevice", tag: "account", method: "PUT", path: "/account/devices/{id}/name", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "renameDevice", tag: "account", method: "PUT", path: "/account/devices/{id}/name", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/RequestEmailVerification.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/RequestEmailVerification.swift index 0dbf9ebd7..90e25537b 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/RequestEmailVerification.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/RequestEmailVerification.swift @@ -18,7 +18,7 @@ for changing an account email address. */ public enum RequestEmailVerification { - public static let service = APIService(id: "requestEmailVerification", tag: "account", method: "POST", path: "/account/request-email-verification", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "requestEmailVerification", tag: "account", method: "POST", path: "/account/request-email-verification", hasBody: false, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateAccount.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateAccount.swift index 2841f716e..0c1639eeb 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateAccount.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateAccount.swift @@ -12,7 +12,7 @@ This supports partial updates so you can send just the properties you wish to up */ public enum UpdateAccount { - public static let service = APIService(id: "updateAccount", tag: "account", method: "PATCH", path: "/account", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Settings"])]) + public static let service = APIService(id: "updateAccount", tag: "account", method: "PATCH", path: "/account", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Settings"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateProfileWithId.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateProfileWithId.swift index 5c155369d..f0199c2da 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateProfileWithId.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Account/UpdateProfileWithId.swift @@ -12,7 +12,7 @@ This supports partial updates so you can send just the properties you wish to up */ public enum UpdateProfileWithId { - public static let service = APIService(id: "updateProfileWithId", tag: "account", method: "PATCH", path: "/account/profiles/{id}", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "updateProfileWithId", tag: "account", method: "PATCH", path: "/account/profiles/{id}", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Authorization/GetProfileToken.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Authorization/GetProfileToken.swift index f64848abc..0f0b67d32 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Authorization/GetProfileToken.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Authorization/GetProfileToken.swift @@ -14,7 +14,7 @@ before access is granted. */ public enum GetProfileToken { - public static let service = APIService(id: "getProfileToken", tag: "authorization", method: "POST", path: "/authorization/profile", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getProfileToken", tag: "authorization", method: "POST", path: "/authorization/profile", hasBody: true, securityRequirements: [SecurityRequirement(type: "accountAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/BookmarkItem.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/BookmarkItem.swift index e229f183c..e9fcb9aa9 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/BookmarkItem.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/BookmarkItem.swift @@ -12,7 +12,7 @@ Creates one if it doesn't exist, overwrites one if it does. */ public enum BookmarkItem { - public static let service = APIService(id: "bookmarkItem", tag: "profile", method: "PUT", path: "/account/profile/bookmarks/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "bookmarkItem", tag: "profile", method: "PUT", path: "/account/profile/bookmarks/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/DeleteItemBookmark.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/DeleteItemBookmark.swift index 10d279761..8d4375ef8 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/DeleteItemBookmark.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/DeleteItemBookmark.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Unbookmark an item under the active profile. */ public enum DeleteItemBookmark { - public static let service = APIService(id: "deleteItemBookmark", tag: "profile", method: "DELETE", path: "/account/profile/bookmarks/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "deleteItemBookmark", tag: "profile", method: "DELETE", path: "/account/profile/bookmarks/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarkList.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarkList.swift index 0a50b77f4..6f13f7eff 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarkList.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarkList.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Returns the list of bookmarked items under the active profile. */ public enum GetBookmarkList { - public static let service = APIService(id: "getBookmarkList", tag: "profile", method: "GET", path: "/account/profile/bookmarks/list", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getBookmarkList", tag: "profile", method: "GET", path: "/account/profile/bookmarks/list", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarks.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarks.swift index b7a86ca06..3daf8e150 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarks.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetBookmarks.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the map of bookmarked item ids (itemId => creationDate) under the active profile. */ public enum GetBookmarks { - public static let service = APIService(id: "getBookmarks", tag: "profile", method: "GET", path: "/account/profile/bookmarks", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getBookmarks", tag: "profile", method: "GET", path: "/account/profile/bookmarks", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemBookmark.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemBookmark.swift index 3cfeaf166..e6cddbb13 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemBookmark.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemBookmark.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the bookmark for an item under the active profile. */ public enum GetItemBookmark { - public static let service = APIService(id: "getItemBookmark", tag: "profile", method: "GET", path: "/account/profile/bookmarks/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getItemBookmark", tag: "profile", method: "GET", path: "/account/profile/bookmarks/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemRating.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemRating.swift index 54d50b5e4..29a282ffa 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemRating.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemRating.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the rating info for an item under the active profile. */ public enum GetItemRating { - public static let service = APIService(id: "getItemRating", tag: "profile", method: "GET", path: "/account/profile/ratings/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getItemRating", tag: "profile", method: "GET", path: "/account/profile/ratings/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemWatchedStatus.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemWatchedStatus.swift index 781c2a844..573a8c663 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemWatchedStatus.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetItemWatchedStatus.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the watched status info for an item under the active profile. */ public enum GetItemWatchedStatus { - public static let service = APIService(id: "getItemWatchedStatus", tag: "profile", method: "GET", path: "/account/profile/watched/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getItemWatchedStatus", tag: "profile", method: "GET", path: "/account/profile/watched/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetProfile.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetProfile.swift index 1a5676f7d..402b944fc 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetProfile.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetProfile.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the details of the active profile, including watched, bookmarked and rated items. */ public enum GetProfile { - public static let service = APIService(id: "getProfile", tag: "profile", method: "GET", path: "/account/profile", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getProfile", tag: "profile", method: "GET", path: "/account/profile", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatings.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatings.swift index 10d4f5c3e..eeeb78c10 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatings.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatings.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the map of rated item ids (itemId => rating out of 10) under the active profile. */ public enum GetRatings { - public static let service = APIService(id: "getRatings", tag: "profile", method: "GET", path: "/account/profile/ratings", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getRatings", tag: "profile", method: "GET", path: "/account/profile/ratings", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatingsList.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatingsList.swift index 952390c9f..7aced3580 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatingsList.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetRatingsList.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Returns the list of rated items under the active profile. */ public enum GetRatingsList { - public static let service = APIService(id: "getRatingsList", tag: "profile", method: "GET", path: "/account/profile/ratings/list", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getRatingsList", tag: "profile", method: "GET", path: "/account/profile/ratings/list", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) /** What to order by. Ordering by `date-modified` equates to ordering by the last rated date. diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatched.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatched.swift index 3fbbe6410..4ac86004a 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatched.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatched.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Get the map of watched item ids (itemId => last playhead position) under the active profile. */ public enum GetWatched { - public static let service = APIService(id: "getWatched", tag: "profile", method: "GET", path: "/account/profile/watched", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getWatched", tag: "profile", method: "GET", path: "/account/profile/watched", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatchedList.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatchedList.swift index d7fb686f8..7abe2b576 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatchedList.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/GetWatchedList.swift @@ -10,7 +10,7 @@ extension Rocket.Profile { /** Returns the list of watched items under the active profile. */ public enum GetWatchedList { - public static let service = APIService(id: "getWatchedList", tag: "profile", method: "GET", path: "/account/profile/watched/list", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "getWatchedList", tag: "profile", method: "GET", path: "/account/profile/watched/list", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) /** What to order by. Ordering by `date-modified` equates to ordering by the last watched date. diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/RateItem.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/RateItem.swift index d1479a6cc..8d8adc83a 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/RateItem.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/RateItem.swift @@ -12,7 +12,7 @@ Creates one if it doesn't exist, overwrites one if it does. */ public enum RateItem { - public static let service = APIService(id: "rateItem", tag: "profile", method: "PUT", path: "/account/profile/ratings/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "rateItem", tag: "profile", method: "PUT", path: "/account/profile/ratings/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/SetItemWatchedStatus.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/SetItemWatchedStatus.swift index ae1a0d505..cf2209048 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Profile/SetItemWatchedStatus.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Profile/SetItemWatchedStatus.swift @@ -13,7 +13,7 @@ Creates one if it doesn't exist, overwrites one if it does. */ public enum SetItemWatchedStatus { - public static let service = APIService(id: "setItemWatchedStatus", tag: "profile", method: "PUT", path: "/account/profile/watched/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", scopes: ["Catalog"])]) + public static let service = APIService(id: "setItemWatchedStatus", tag: "profile", method: "PUT", path: "/account/profile/watched/{itemId}", hasBody: false, securityRequirements: [SecurityRequirement(type: "profileAuth", isRequired: true, scopes: ["Catalog"])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Support/ResetPassword.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Support/ResetPassword.swift index 305edf28d..eabb4050a 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Support/ResetPassword.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Support/ResetPassword.swift @@ -18,7 +18,7 @@ header as a bearer token. */ public enum ResetPassword { - public static let service = APIService(id: "resetPassword", tag: "support", method: "POST", path: "/reset-password", hasBody: true, securityRequirements: [SecurityRequirement(type: "resetPasswordAuth", scopes: [])]) + public static let service = APIService(id: "resetPassword", tag: "support", method: "POST", path: "/reset-password", hasBody: true, securityRequirements: [SecurityRequirement(type: "resetPasswordAuth", isRequired: true, scopes: [])]) public final class Request: APIRequest { diff --git a/Specs/Rocket/generated/Swift/Sources/Requests/Support/VerifyEmail.swift b/Specs/Rocket/generated/Swift/Sources/Requests/Support/VerifyEmail.swift index 08f8c91e3..6e483cab6 100644 --- a/Specs/Rocket/generated/Swift/Sources/Requests/Support/VerifyEmail.swift +++ b/Specs/Rocket/generated/Swift/Sources/Requests/Support/VerifyEmail.swift @@ -17,7 +17,7 @@ may need to request a new verification email be sent. This can be done via the e */ public enum VerifyEmail { - public static let service = APIService(id: "verifyEmail", tag: "support", method: "POST", path: "/verify-email", hasBody: false, securityRequirements: [SecurityRequirement(type: "verifyEmailAuth", scopes: [])]) + public static let service = APIService(id: "verifyEmail", tag: "support", method: "POST", path: "/verify-email", hasBody: false, securityRequirements: [SecurityRequirement(type: "verifyEmailAuth", isRequired: true, scopes: [])]) public final class Request: APIRequest { diff --git a/Specs/TBX/generated/Swift/Sources/APIService.swift b/Specs/TBX/generated/Swift/Sources/APIService.swift index 4cf2264f2..dc630b379 100644 --- a/Specs/TBX/generated/Swift/Sources/APIService.swift +++ b/Specs/TBX/generated/Swift/Sources/APIService.swift @@ -37,10 +37,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Specs/TFL/generated/Swift/Sources/APIService.swift b/Specs/TFL/generated/Swift/Sources/APIService.swift index 4cf2264f2..dc630b379 100644 --- a/Specs/TFL/generated/Swift/Sources/APIService.swift +++ b/Specs/TFL/generated/Swift/Sources/APIService.swift @@ -37,10 +37,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Specs/TestSpec/generated/Swift/Sources/APIService.swift b/Specs/TestSpec/generated/Swift/Sources/APIService.swift index 4cf2264f2..dc630b379 100644 --- a/Specs/TestSpec/generated/Swift/Sources/APIService.swift +++ b/Specs/TestSpec/generated/Swift/Sources/APIService.swift @@ -37,10 +37,12 @@ extension APIService: CustomStringConvertible { public struct SecurityRequirement { public let type: String + public let isRequired: Bool public let scopes: [String] - public init(type: String, scopes: [String]) { + public init(type: String, isRequired: Bool, scopes: [String]) { self.type = type + self.isRequired = isRequired self.scopes = scopes } } diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/GetDefaultResponse.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/GetDefaultResponse.swift index 5e6105783..fc5bbc76c 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/GetDefaultResponse.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/GetDefaultResponse.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with no responses */ public enum GetDefaultResponse { - public static let service = APIService(id: "getDefaultResponse", tag: "", method: "GET", path: "/default-response", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "getDefaultResponse", tag: "", method: "GET", path: "/default-response", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/GetFile.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/GetFile.swift index aebe1f541..2e0e57199 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/GetFile.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/GetFile.swift @@ -10,7 +10,7 @@ extension TestSpec { /** Binary response */ public enum GetFile { - public static let service = APIService(id: "getFile", tag: "", method: "GET", path: "/file", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "getFile", tag: "", method: "GET", path: "/file", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/GetInlineEnumResponse.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/GetInlineEnumResponse.swift index 94addf626..8cfde95e7 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/GetInlineEnumResponse.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/GetInlineEnumResponse.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with an enum response */ public enum GetInlineEnumResponse { - public static let service = APIService(id: "getInlineEnumResponse", tag: "", method: "GET", path: "/inlineEnumResponse", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "getInlineEnumResponse", tag: "", method: "GET", path: "/inlineEnumResponse", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleParams.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleParams.swift index b58e426c5..328d9b032 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleParams.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleParams.swift @@ -10,7 +10,7 @@ extension TestSpec { /** Has path and operation parameters */ public enum GetMultipleParams { - public static let service = APIService(id: "getMultipleParams", tag: "", method: "GET", path: "/multiple-path-params{petID}", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "getMultipleParams", tag: "", method: "GET", path: "/multiple-path-params{petID}", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleSuccess.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleSuccess.swift index c6862446c..0ef4adac3 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleSuccess.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/GetMultipleSuccess.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with multiple success responses */ public enum GetMultipleSuccess { - public static let service = APIService(id: "getMultipleSuccess", tag: "", method: "GET", path: "/multiple-success", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["write"])]) + public static let service = APIService(id: "getMultipleSuccess", tag: "", method: "GET", path: "/multiple-success", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["write"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/GetString.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/GetString.swift index 4c4fbe259..8501a7645 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/GetString.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/GetString.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with string response */ public enum GetString { - public static let service = APIService(id: "getString", tag: "", method: "GET", path: "/string", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "getString", tag: "", method: "GET", path: "/string", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/Pets.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/Pets.swift index 0efc5dcac..7b5fa9f45 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/Pets.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/Pets.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with a tag */ public enum Pets { - public static let service = APIService(id: "Pets", tag: "", method: "GET", path: "/tagged", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "Pets", tag: "", method: "GET", path: "/tagged", hasBody: false, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/PostAllParams.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/PostAllParams.swift index fe250ae1c..e1874ad65 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/PostAllParams.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/PostAllParams.swift @@ -10,7 +10,7 @@ extension TestSpec { /** Has all sorts of parameters */ public enum PostAllParams { - public static let service = APIService(id: "postAllParams", tag: "", method: "POST", path: "/all-params", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "postAllParams", tag: "", method: "POST", path: "/all-params", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/PostInlinebody.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/PostInlinebody.swift index 841c29d02..b4f6b55a4 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/PostInlinebody.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/PostInlinebody.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with an inline body */ public enum PostInlinebody { - public static let service = APIService(id: "postInlinebody", tag: "", method: "POST", path: "/inlinebody", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["write"])]) + public static let service = APIService(id: "postInlinebody", tag: "", method: "POST", path: "/inlinebody", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["write"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/PostString.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/PostString.swift index 91f5d1c40..d76b2d149 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/PostString.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/PostString.swift @@ -10,7 +10,7 @@ extension TestSpec { /** operation with string body */ public enum PostString { - public static let service = APIService(id: "postString", tag: "", method: "POST", path: "/string", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "postString", tag: "", method: "POST", path: "/string", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest { diff --git a/Specs/TestSpec/generated/Swift/Sources/Requests/UpdateWithForm.swift b/Specs/TestSpec/generated/Swift/Sources/Requests/UpdateWithForm.swift index deadf8e4e..0ceffb508 100644 --- a/Specs/TestSpec/generated/Swift/Sources/Requests/UpdateWithForm.swift +++ b/Specs/TestSpec/generated/Swift/Sources/Requests/UpdateWithForm.swift @@ -10,7 +10,7 @@ extension TestSpec { /** Posts a form */ public enum UpdateWithForm { - public static let service = APIService(id: "updateWithForm", tag: "", method: "POST", path: "/post-form", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", scopes: ["read"])]) + public static let service = APIService(id: "updateWithForm", tag: "", method: "POST", path: "/post-form", hasBody: true, securityRequirements: [SecurityRequirement(type: "test_auth", isRequired: true, scopes: ["read"])]) public final class Request: APIRequest {