-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* split filename template * update package name with test * add paths generation * remove old filename test * fix tests for swiftlint removal
- Loading branch information
Showing
19 changed files
with
211 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Sources/CreateOptions/ConfigOptions+DecodableWithDefault.swift
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Tests/CreateAPITests/Expected/petstore-entity-filename-template/Package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// swift-tools-version:5.5 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "petstore-entity-filename-template", | ||
platforms: [.iOS(.v13), .macCatalyst(.v13), .macOS(.v10_15), .watchOS(.v6), .tvOS(.v13)], | ||
products: [ | ||
.library(name: "petstore-entity-filename-template", targets: ["petstore-entity-filename-template"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/kean/Get", from: "1.0.2") | ||
], | ||
targets: [ | ||
.target(name: "petstore-entity-filename-template", dependencies: [ | ||
.product(name: "Get", package: "Get") | ||
], path: "Sources") | ||
] | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Tests/CreateAPITests/Expected/petstore-filename-template/Sources/Entities+CodingKey.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Generated by Create API | ||
// https://github.com/CreateAPI/CreateAPI | ||
|
||
import Foundation | ||
|
||
struct StringCodingKey: CodingKey, ExpressibleByStringLiteral { | ||
private let string: String | ||
private var int: Int? | ||
|
||
var stringValue: String { return string } | ||
|
||
init(string: String) { | ||
self.string = string | ||
} | ||
|
||
init?(stringValue: String) { | ||
self.string = stringValue | ||
} | ||
|
||
var intValue: Int? { return int } | ||
|
||
init?(intValue: Int) { | ||
self.string = String(describing: intValue) | ||
self.int = intValue | ||
} | ||
|
||
init(stringLiteral value: String) { | ||
self.string = value | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Tests/CreateAPITests/Expected/petstore-filename-template/Sources/Entities/ErrorModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Generated by Create API | ||
// https://github.com/CreateAPI/CreateAPI | ||
|
||
import Foundation | ||
|
||
public struct Error: Codable { | ||
public var code: Int | ||
public var message: String | ||
|
||
public init(code: Int, message: String) { | ||
self.code = code | ||
self.message = message | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Tests/CreateAPITests/Expected/petstore-filename-template/Sources/Entities/PetModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Generated by Create API | ||
// https://github.com/CreateAPI/CreateAPI | ||
|
||
import Foundation | ||
|
||
/// A pet title | ||
/// | ||
/// A pet description | ||
public struct Pet: Codable { | ||
public var id: Int | ||
/// Example: "Buddy" | ||
public var name: String | ||
public var tag: String? | ||
|
||
public init(id: Int, name: String, tag: String? = nil) { | ||
self.id = id | ||
self.name = name | ||
self.tag = tag | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Tests/CreateAPITests/Expected/petstore-filename-template/Sources/Entities/StoreModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Generated by Create API | ||
// https://github.com/CreateAPI/CreateAPI | ||
|
||
import Foundation | ||
|
||
public struct Store: Codable { | ||
public var pets: [Pet] | ||
|
||
public init(pets: [Pet]) { | ||
self.pets = pets | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.