tayloraswift / swift-json

high-performance json parsing and encoding for server applications
https://swiftinit.org/docs/swift-json
Apache License 2.0
82 stars 5 forks source link

add a “one-step” decode API #47

Closed tayloraswift closed 2 years ago

tayloraswift commented 2 years ago

feedback on current API is that is is too complex and expects users to interact with swift-grammar types. this API exists to support high-performance use-cases, but many other use cases just want to parse a String and dispatch to Decodable.

in particular, we should have

let _:SomeDecodable = try .init(from: try JSON.init(parsing: #"{ "x": 1 }"#))
tayloraswift commented 2 years ago

implemented in master by #52