vapor-community / stripe

Stripe library for Vapor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace Node in route initializers and specify a stronger type to then convert to Node

Andrewangeta opened this issue · comments

Routes only take In Nodes for collection types like JSON, Arrays of JSON, Dictionaries, Arrays etc. It's worth adding the specific type we're looking for in the parameter list and then convert it to node inside the api call. This would help make the API more easier to use and leaves out the guessing of what type the API is looking for. For example

This

create(name: String, id: String?, active: Bool?, attributes: Node?, caption: String?, deactivateOn: Node?, description: String?, images: Node?, packageDimensions: Node?, shippable: Bool?, url: String?, metadata: Node? = nil)

would become this

create(name: String, id: String?, active: Bool?, attributes: [String]?, caption: String?, deactivateOn: [String]?, description: String?, images: [String]?, packageDimensions: Node?, shippable: Bool?, url: String?, metadata: [String: Node]? = nil)

No more node is Vapor 3. Only Version 2.0 of the library will be maintained going forward.