Swiftpack.co - elegantchaos/JSONRepresentable as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by elegantchaos.
elegantchaos/JSONRepresentable v1.0.1
Swift to JSON conversion utilities
⭐️ 0
🕓 2 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/elegantchaos/JSONRepresentable.git", from: "v1.0.1")

JSONRepresentable

This package defines two protocols: JSONType and JSONRepresentable.

JSONType

Types which conform to JSONType can be directly represented in JSON.

The package adds conformance to Swift's basic types: Bool, Int, Double, String.

It defines a dictionary type JSONDictionary, with String keys and JSONType values.

It also defines an array type JSONArray, with JSONType values.

JSONRepresentable

Types which conform to JSONRepresentable can be converted into a JSONType, using the asJSONType method.

The package adds conformance to JSONRepresentable to various standard types:

  • Array (where Element is JSONRepresentable)
  • CFString
  • Date
  • NSArray
  • NSDate
  • NSDictionary
  • NSNumber
  • NSNull
  • NSString

GitHub

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

Release Notes

1.0.1
2 weeks ago

Added NSNumber, NSNull conformance to JSONRepresentable.

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