-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from eneko/master
Add support for OpenAPI DataTypes
- Loading branch information
Showing
9 changed files
with
390 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// APIDataType.swift | ||
// Swiftgger | ||
// | ||
// Created by Eneko Alonso on 2/2/19. | ||
// | ||
|
||
import Foundation | ||
|
||
/// OpenAPI Data Types as specified in https://swagger.io/specification/#dataTypes | ||
public struct APIDataType { | ||
let type: String | ||
let format: String? | ||
|
||
public static let int32 = APIDataType(type: "integer", format: "int32") | ||
public static let int64 = APIDataType(type: "integer", format: "int64") | ||
public static let float = APIDataType(type: "number", format: "float") | ||
public static let double = APIDataType(type: "number", format: "double") | ||
public static let string = APIDataType(type: "string", format: nil) | ||
public static let byte = APIDataType(type: "string", format: "byte") | ||
public static let binary = APIDataType(type: "string", format: "binary") | ||
public static let boolean = APIDataType(type: "boolean", format: nil) | ||
public static let date = APIDataType(type: "string", format: "date") | ||
public static let dateTime = APIDataType(type: "string", format: "date-time") | ||
public static let password = APIDataType(type: "string", format: "password") | ||
} |
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.