Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix json conversion #25

Merged
merged 3 commits into from
Apr 4, 2018
Merged

Fix json conversion #25

merged 3 commits into from
Apr 4, 2018

Conversation

aug24
Copy link
Contributor

@aug24 aug24 commented Apr 4, 2018

Correct construction of "target" field in json output. It needs to be an object containing zero or more target fields, not a string.

}
"produces valid JSON for all" in {
targetJson(List(Stack("stack"), Stage("stage"), App("app"), AwsAccount("123456789"))) shouldEqual
"""{"Stack":"stack","Stage":"stage","App":"app","AwsAccount":"123456789"}"""
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking about making the project depend on circe for tests. We could parse the resulting JSON and inspect the keys, rather than check it as a string. This would also allow a test for "this actually parses" which would have value itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

(the issue here is that the test passing is coupled to the order of a data structure that is technically "unordered")

Copy link
Contributor

Choose a reason for hiding this comment

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

(I know this isn't the only place where this happens and happy for that to be a separate change in a bit)

@aug24 aug24 merged commit 569ea1f into master Apr 4, 2018
@aug24 aug24 deleted the fix-json-client branch April 4, 2018 10:10
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.

None yet

2 participants