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

Problem comparing arrays in JSONs #6

Closed
AndreaCimminoArriaga opened this issue Jul 6, 2021 · 2 comments · Fixed by #29
Closed

Problem comparing arrays in JSONs #6

AndreaCimminoArriaga opened this issue Jul 6, 2021 · 2 comments · Fixed by #29

Comments

@AndreaCimminoArriaga
Copy link
Contributor

I got the following FAIL, however the unique difference between the expected and actually retrieved TD is the order of the elements in the array forms

--- FAIL: TestPatch/replace_array/result (0.02s)
            registration_test.go:837: Expected:
                {
                	"@context": "https://www.w3.org/2019/wot/td/v1",
                	"id": "urn:uuid:b537f14f-2363-4eb5-b3d4-d25b9a3a2df4",
                	"properties": {
                		"status": {
                			"forms": [
                				{
                					"href": "https://mylamp.example.com/status"
                				},
                				{
                					"href": "coaps://mylamp.example.com/status"
                				}
                			]
                		}
                	},
                	"security": [
                		"nosec_sc"
                	],
                	"securityDefinitions": {
                		"nosec_sc": {
                			"scheme": "nosec"
                		}
                	},
                	"title": "example thing"
                }
                 Retrieved:
                {
                	"@context": "https://www.w3.org/2019/wot/td/v1",
                	"id": "urn:uuid:b537f14f-2363-4eb5-b3d4-d25b9a3a2df4",
                	"properties": {
                		"status": {
                			"forms": [
                				{
                					"href": "coaps://mylamp.example.com/status"
                				},
                				{
                					"href": "https://mylamp.example.com/status"
                				}
                			]
                		}
                	},
                	"security": [
                		"nosec_sc"
                	],
                	"securityDefinitions": {
                		"nosec_sc": {
                			"scheme": "nosec"
                		}
                	},
                	"title": "example thing"
                }
@ethieblin
Copy link

We have the same issue

@farshidtz
Copy link
Owner

Resolved by #29

@farshidtz farshidtz changed the title Problem comparing Jsons Problem comparing arrays in JSONs Jun 8, 2022
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 a pull request may close this issue.

3 participants