Sitelet https://github.com/ishkawa/APIKit/pull/275
Skip to content

ExpressibleByDictionaryLiteral for JSONBodyParameters - #275

Merged
Econa77 merged 1 commit into
ishkawa:masterfrom
417-72KI:feature/dictionary-literal-for-json-body-parameters
Feb 24, 2021
Merged

Econa77 merged 1 commit into
ishkawa:masterfrom
417-72KI:feature/dictionary-literal-for-json-body-parameters

Conversation

@417-72KI

Copy link
Copy Markdown
Contributor

There are redundant codes for initializing JSONBodyParameters.
I make it possible to initialize simply from Dictionary Literal.

Before

let object = ["foo": 1, "bar": 2, "baz": 3]
let parameters = JSONBodyParameters(JSONObject: object)

After

let parameters: JSONBodyParameters = ["foo": 1, "bar": 2, "baz": 3]

or

let parameters = ["foo": 1, "bar": 2, "baz": 3] as JSONBodyParameters

@Econa77 Econa77 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@Econa77
Econa77 merged commit 06f45d7 into ishkawa:master Feb 24, 2021
@417-72KI
417-72KI deleted the feature/dictionary-literal-for-json-body-parameters branch March 17, 2021 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants