Skip to content

Implementation of CodableResultClosure with QueryParameters#1253

Merged
ianpartridge merged 1 commit intoKitura:masterfrom
saiHemak:codableResultClosure
May 3, 2018
Merged

Implementation of CodableResultClosure with QueryParameters#1253
ianpartridge merged 1 commit intoKitura:masterfrom
saiHemak:codableResultClosure

Conversation

@saiHemak
Copy link
Copy Markdown
Contributor

In this PR I am implementing the support for CodableResultClosure with QueryParameters

Description

At the moment the router handler forces the users to use the CodableArrayResultClosure type only. Compilation fails if the application is expecting a Simple Codable type with QueryParameters.

Motivation and Context

Application needs a Simple JSON object instead of Array of JSON objects.As the current implementation does not allow a SimpleCodable type to be returned , I have implemented the same.

How Has This Been Tested?

Ran Kitura test-suite with my changes

Checklist:

  • If applicable, I have updated the documentation accordingly.
  • [ x] If applicable, I have added tests to cover my changes.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 18, 2018

CLA assistant check
All committers have signed the CLA.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 18, 2018

Codecov Report

Merging #1253 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1253      +/-   ##
==========================================
+ Coverage   89.04%   89.08%   +0.03%     
==========================================
  Files          38       38              
  Lines        2292     2300       +8     
==========================================
+ Hits         2041     2049       +8     
  Misses        251      251
Flag Coverage Δ
#Kitura 89.08% <100%> (+0.03%) ⬆️
Impacted Files Coverage Δ
Sources/Kitura/CodableRouter.swift 80.3% <100%> (+0.62%) ⬆️
Sources/Kitura/bodyParser/BodyParser.swift 81.15% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91700b0...767795d. Read the comment docs.

@saiHemak saiHemak force-pushed the codableResultClosure branch from db90043 to 41b156a Compare April 19, 2018 11:11
@@ -39,7 +39,8 @@ class TestCodableRouter: KituraTest {
("testRouteParameters", testRouteParameters),
("testCodableRoutesWithBodyParsingFail", testCodableRoutesWithBodyParsingFail),
("testCodableGetQueryParameters", testCodableGetQueryParameters),
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.

Please rename this test to "testCodableGetSingleQueryParameters", then follow it with your new "testCodableGetArrayQueryParameters" test, then finish the array with the existing "testCodableDeleteQueryParameters" test.

That way the test naming is consistent with the non-queryparams cases.

@saiHemak saiHemak force-pushed the codableResultClosure branch from 41b156a to 1b156c3 Compare April 19, 2018 17:25
@saiHemak
Copy link
Copy Markdown
Contributor Author

@ianpartridge I have renamed the new test case to testCodableGetSingleQueryParameters and testCodableGetQueryParameters```` to testCodableGetArrayQueryParameters``` . Please review

Copy link
Copy Markdown
Contributor

@Andrew-Lees11 Andrew-Lees11 left a comment

Choose a reason for hiding this comment

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

LGTM

@djones6
Copy link
Copy Markdown
Collaborator

djones6 commented May 1, 2018

@saiHemak is this ready to merge?

@saiHemak saiHemak force-pushed the codableResultClosure branch from 5d39476 to 767795d Compare May 3, 2018 06:32
@saiHemak
Copy link
Copy Markdown
Contributor Author

saiHemak commented May 3, 2018

@djones6 Changes were approved.Can you please merge

@ianpartridge ianpartridge merged commit 47aa9b0 into Kitura:master May 3, 2018
djones6 added a commit that referenced this pull request May 9, 2018
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.

6 participants