Skip to content

Instantly share code, notes, and snippets.

@verma verma/interface-test.clj
Last active Apr 18, 2018

Embed
What would you like to do?
(ns ramlpg.core
(:import [org.raml.v2.api RamlModelBuilder]
[org.raml.v2.internal.impl.commons.model.type
TypeDeclaration
FileTypeDeclaration
ArrayTypeDeclaration ObjectTypeDeclaration]))
(defn parse-raml [raml-resource]
(let [api (.buildApi (RamlModelBuilder.) raml-resource)]
(println (.isVersion10 api))
(println (.isVersion08 api))
(println (.hasErrors api))
(.getApiV10 api)))
(defonce api (parse-raml "resources/api.raml"))
;; relevant part of the code
(doseq [s (seq (.types api))]
(println s)
(println (type s))
(println (instance? FileTypeDeclaration s)))
#object[com.sun.proxy.$Proxy10 0x56e1b91a org.raml.v2.internal.impl.commons.model.type.FileTypeDeclaration@2f929b72]
com.sun.proxy.$Proxy10
false
#object[com.sun.proxy.$Proxy10 0x565d5a5c org.raml.v2.internal.impl.commons.model.type.FileTypeDeclaration@4a7bd89a]
com.sun.proxy.$Proxy10
false
#object[com.sun.proxy.$Proxy11 0x5eb7d0da org.raml.v2.internal.impl.commons.model.type.UnionTypeDeclaration@772d192]
com.sun.proxy.$Proxy11
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.