Skip to content

Commit

Permalink
Update to 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Aug 24, 2018
1 parent 44e21c9 commit 7fc60bb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Change Log
## Master

## [3.0.0](https://github.com/yonaskolb/SwagGen/compare/2.1.2...3.0.0)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TOOL_NAME = swaggen
VERSION = 2.1.2
VERSION = 3.0.0

PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwagGen/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PathKit
import SwagGenKit
import SwiftCLI

let version = "2.1.2"
let version = "3.0.0"
let generateCommand = GenerateCommand()
let cli = CLI(name: "swaggen", version: version, description: "Swagger code generator", commands: [generateCommand])
cli.goAndExit()
4 changes: 2 additions & 2 deletions Sources/SwagGenKit/CodeFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public class CodeFormatter {

return context
}

func getOperationContext(_ operation: Swagger.Operation) -> Context {
var context: Context = [:]

Expand Down Expand Up @@ -218,7 +218,7 @@ public class CodeFormatter {
context["formParams"] = operation.getParameters(type: .formData).map(getParameterContext)
context["headerParams"] = operation.getParameters(type: .header).map(getParameterContext)
context["hasFileParam"] = params.contains { $0.metadata.type == .file }

let securityRequirements = operation.securityRequirements ?? spec.securityRequirements
context["securityRequirement"] = securityRequirements?.first.flatMap(getSecurityRequirementContext)
context["securityRequirements"] = securityRequirements?.map(getSecurityRequirementContext)
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwagGenKit/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extension String {
var index = 0
let components = self.components(separatedBy: seperator)
if uppercased() == self {
return components.map { $0.lowercased().mapFirstChar { $0.uppercased()} }.joined(separator: "")
return components.map { $0.lowercased().mapFirstChar { $0.uppercased() } }.joined(separator: "")
}
return components
.map { string in
Expand Down Expand Up @@ -106,7 +106,7 @@ extension String {
}

private var hasSeparator: Bool {
return separators.contains(where: { contains($0)})
return separators.contains(where: { contains($0) })
}

private var isAcronym: Bool {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwagGenKitTests/GeneratorTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import XCTest
import Spectre
@testable import SwagGenKit
import XCTest

public func testGenerator() {

Expand Down

0 comments on commit 7fc60bb

Please sign in to comment.