steinfletcher / apitest-jsonpath Goto Github PK
View Code? Open in Web Editor NEWJSONPath assertions for apitest
Home Page: https://apitest.dev
License: MIT License
JSONPath assertions for apitest
Home Page: https://apitest.dev
License: MIT License
apitest.New().
Handler(handler).
Get("/articles?category=golang").
Expect(t).
Assert(jsonpath.Len(`$.items`, 3).
End()
Misses closing parentheses in assert.
Hi, I was trying to read the documentation for this code today, and it will not display on https://pkg.go.dev/github.com/steinfletcher/apitest-jsonpath, and the reason given is "Documentation not displayed due to license restrictions."
I think the issue might be that there is no LICENSE file at all for this code; this may also make developers hesitant to use it. Thanks! I have been enjoying learning about and using apitest.
Here is my assertion:
jsonpath.Equal(`$.items[?(@._links.parent.href == "PATH")].name`), "active"),
And the error I'm getting
Received unexpected error:
"[active]" not equal to "active"
So i changed to This
jsonpath.Equal(`$.items[?(@._links.parent.href == "PATH")].name`), "[active]"),
and now the error is...
Received unexpected error:
"[active]" not equal to "[active]"
Probably more of a question than an issue, but possibly the documentation could reflect this.
Given JSON like
[
{
"id": 1,
"created_at": "2023-04-21"
},
{
"id": 2,
"created_at": "2023-04-22"
},
{
"id": 3,
"created_at": "2023-04-23"
},
{
"id": 4,
"created_at": "2023-04-24"
}
]
Then asserting
Assert(jsonpath.Equal(`$[*].id`, [4]float64{1, 2, 3, 4}))
Results in
"[%!s(float64=1) %!s(float64=2) %!s(float64=3) %!s(float64=4)]" not equal to "[%!s(float64=1) %!s(float64=2) %!s(float64=3) %!s(float64=4)]"
Those look identical.
What's the correct way to assert on all of the IDs at once?
This is a neat idea provided by REST assured
https://github.com/rest-assured/rest-assured/wiki/Usage#root-path
Dependabot can't resolve your Go dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.