gga / janus Goto Github PK
View Code? Open in Web Editor NEWConsumer-driven contracts, both ways
Consumer-driven contracts, both ways
According to the json_path tests, this is how to get an array:
(at-path "$.foo[*]" {:foo ["a", "b", "c"]}) => ["a", "b", "c"]
Whenever I select an element that is an array, it looks like the verify-document
function calls verify-clause
on each of the elements, checking if the element is of type array, which it isn't.
Output:
$ java -jar janus-0.0.2-standalone.jar --verify myservice.jns
verify-document: doc {"links":[{"href":"http://myservice.example.com/v3/channels","rel":"channels"},{"href":"http://config.example.com/v1/","rel":"config"},{"href":"http://myservice.example.com/v3/","rel":"self"}]} clauses ([:path $.links[*] :of-type :array])
verify-seq: actual-seq [{:href http://myservice.example.com/v3/channels, :rel channels} {:href http://config.example.com/v1/, :rel config} {:href http://myservice.example.com/v3/, :rel self}] clause [:path $.links[*] :of-type :array]
verify-clause: value {:href http://myservice.example.com/v3/channels, :rel channels} clause [:path $.links[*] :of-type :array]
of-type: actual {:href http://myservice.example.com/v3/channels, :rel channels}
verify-clause: value {:href http://config.example.com/v1/, :rel config} clause [:path $.links[*] :of-type :array]
of-type: actual {:href http://config.example.com/v1/, :rel config}
verify-clause: value {:href http://v3/, :rel self} clause [:path $.links[*] :of-type :array]
of-type: actual {:href http://myservice.example.com/v3/, :rel self}
1 service (1 failed)
My Service:
root resource:
Expected "{:href "http://myservice.example.com/v3/channels", :rel "channels"}" to be array, at path $.links[*]
Expected "{:href "http://config.example.com/v1/", :rel "config"}" to be array, at path $.links[*]
Expected "{:href "http://myservice.example.com/v3/", :rel "self"}" to be array, at path $.links[*]
myservice.jns:
(service
"My Service"
(contract "root resource"
(method :get)
(url "http://myservice.example.com/v3/?param1=a¶m2=24")
(header "Accept-Language" "en_US")
(header "Accept" "application/json")
(should-have :path "$.links[*]" :of-type :array)))
Response:
{
"links": [
{
"href": "http://myservice.example.com/v3/channels",
"rel": "channels"
},
{
"href": "http://config.example.com/v1/",
"rel": "config"
},
{
"href": "http://myservice.example.com/v3/",
"rel": "self"
}
]
}
Is it possible to get a Janus jar onto Clojars?
When I attempt to create a local jar "lein jar", I receive:
java.io.FileNotFoundException: Could not locate midje/sweet__init.class or midje/sweet.clj on classpath:
Many Thanks
Aidy
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.