Git Product home page Git Product logo

janus's Issues

Can't get :of-type :array to work

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&param2=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"
    }
  ]
}

Janus onto Clojars?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.