-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Avoids calling SwiftFormat on nested types. Added a format function to the base Renderer class so it’s now the only type that needs to import SwiftFormat. Generator now passes `shouldFormat: true` to the top level renderers so it’s only run once per file. * Updated the generators to create the Codable implementation. * Generated the models with the Codable implementation. * Added AnyCodingKey to use in all Codable implementations. * Generated the models using AnyCodingKey. * Added the API spec file to gitignore. * Updated tests to contain the Codable implementation. * Updated OneOfSchemaRenderer to be a Renderer and use renderEnum. * Removed try! when used in a throwing function. * Format rendered code in tests explicitly * Ignore code coverage of AnyCodingKey --------- Co-authored-by: Morten Bjerg Gregersen <[email protected]>
- Loading branch information
1 parent
03fa9fa
commit 5f3c9e9
Showing
812 changed files
with
31,485 additions
and
22,632 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ xcuserdata | |
.build | ||
coverage.lcov | ||
docs | ||
app_store_connect_api_openapi.json |
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,26 @@ | ||
public struct AnyCodingKey: CodingKey { | ||
public let stringValue: String | ||
public let intValue: Int? = nil | ||
|
||
public init?(stringValue: String) { | ||
self.stringValue = stringValue | ||
} | ||
|
||
public init?(intValue: Int) { | ||
nil // We are not using this, so just return nil | ||
} | ||
} | ||
|
||
extension AnyCodingKey: ExpressibleByStringLiteral { | ||
public init(stringLiteral value: StringLiteralType) { | ||
self.stringValue = value | ||
} | ||
|
||
public init(unicodeScalarLiteral value: String) { | ||
self.stringValue = value | ||
} | ||
|
||
public init(extendedGraphemeClusterLiteral value: String) { | ||
self.stringValue = value | ||
} | ||
} |
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
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
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
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
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.