This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { "@vocab": "http://todosapp.com/api/vocab#" }, | |
"@id": "http://todosapp.com/api/version_7/#self", | |
"@type": "http://todosapp.com/api/vocab#EntryPoint", | |
"users_url": { "@id": "http://todosapp.com/api/version_7/users#self" } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X GET "http://todosapp.com/api/version_7/spec#EntryPoint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { | |
"hydra": "http://www.w3.org/ns/hydra/core#" | |
}, | |
"@id": "http://todosapp.com/api/vocab#self", | |
"@type": "hydra:ApiDocumentation", | |
"hydra:entryPoint": { "@id":"http://todosapp.com/api/version_7/#self" }, | |
"hydra:supportedClass": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Link: <http://todosapp.com/api/vocab>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns api-modelling-framework.parser.domain.common-test | |
#?(:cljs (:require-macros [cljs.test :refer [deftest is async]])) | |
(:require #?(:clj [clojure.test :refer :all]) | |
[api-modelling-framework.parser.domain.common :as common] | |
[api-modelling-framework.model.document :as document] | |
[api-modelling-framework.model.vocabulary :as v] | |
[api-modelling-framework.utils :as utils])) | |
(deftest wrapped-ast-token?-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn apply-template [uri parameters {:keys [result]}] | |
(reduce (fn [acc {:keys [name property]}] | |
(let [value (get result property) | |
value (or (get value "@value") (get value "@id"))] | |
(if (nil? value) | |
(throw (Exception. (str "Missing parameter " name " for template " uri))) | |
(string/replace uri (str "{" name "}") (str value))))) | |
uri | |
parameters)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn apply-template [uri parameters {:keys [result]}] | |
(reduce (fn [acc {:keys [name property]}] | |
(let [value (get result property) | |
value (or (get value "@value") (get value "@id"))] | |
(if (nil? value) | |
(throw (Exception. (str "Missing parameter " name " for template " uri))) | |
(string/replace uri (str "{" name "}") (str value))))) | |
uri | |
parameters)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest error-1 | |
(let [input {"Foo" {:properties {:id "string"}} | |
"Foos" "Foo[]"} | |
expanded (expanded-form "Foos" input) | |
canonical (canonical-form expanded)] | |
(is (= canonical | |
{:type "array", | |
:items | |
{:properties {"id" {:type "string", :required true}}, | |
:additionalProperties true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@id": "http://localhost:4567/customers/$ID", | |
"payload:email": "?email", | |
"payload:account_owner": { | |
"payload:amount": "?amount" | |
}, | |
"payload:reports": { | |
"payload:provider": "?provider", | |
"payload:score": "?score" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"raml-http:path": "?path", | |
"hydra:supportedOperation": | |
{ | |
"hydra:method": "?method", | |
"hydra:returns": { | |
"hydra:statusCode": "200" | |
} | |
} | |
} |