Swiftpack.co - juliofruta/CodableCode as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by juliofruta.
juliofruta/CodableCode 1.0.2
Swift Package that allows you to convert JSON Strings into Swift structs.
⭐️ 2
🕓 2 weeks ago
macOS
.package(url: "https://github.com/juliofruta/CodableCode.git", from: "1.0.2")

String + CodableCode

Instance Property

CodableCode

Codable code is a Swift Package that allows you to convert JSON Strings into Swift structs.


The following code:

print("""
{
  "greeting": "Welcome to quicktype!",
  "instructions": [
    "Type or paste JSON here",
    "Or choose a sample above",
    "quicktype will generate code in your",
    "chosen language to parse the sample data"
  ]
}
""".codableCode!)

Outputs:

struct <#SomeType#>: Codable {
    let greeting: String
    let instructions: [String]
}

Declaration

var codableCode: String? { get }

See Also

Throwing an error and setting a type name

func makeCodableCode(name:) throws

GitHub

link
Stars: 2
Last commit: Yesterday
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Fix formatting
3 weeks ago

Fixes indentation for subtypes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics