Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger generation breaks when running from cursive/figwheel-sidecar #709

Open
willspecht opened this issue Jul 17, 2018 · 2 comments
Open

Comments

@willspecht
Copy link

willspecht commented Jul 17, 2018

I’m trying to add swagger docs to my endpoints in a project using figwheel. When I run figwheel from the command line lein figwheel dev it works . But, if I use figwheel in the cursive repl as documented here: https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL
I get this error

java.lang.AbstractMethodError: Method linked/map/LinkedMap.isEmpty()Z is abstract
 at linked.map.LinkedMap.isEmpty (map.cljc:-1)
    com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize (MapSerializer.java:627)
    com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize (MapSerializer.java:33)
    com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields (MapSerializer.java:718)
    com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize (MapSerializer.java:639)
    com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize (MapSerializer.java:33)
    com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize (DefaultSerializerProvider.java:480)
    com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue (DefaultSerializerProvider.java:319)
    com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue (ObjectMapper.java:3905)
    com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes (ObjectMapper.java:3243)
    jsonista.core$write_value_as_bytes.invokeStatic (core.clj:229)
    jsonista.core$write_value_as_bytes.invoke (core.clj:221)
    muuntaja.format.json$encoder$reify__32936.encode_to_bytes (json.clj:43)
    muuntaja.core$create_coder$encode__33315.invoke (core.clj:344)
    clojure.core$update.invokeStatic (core.clj:6080)
    clojure.core$update.invoke (core.clj:6070)
    muuntaja.core$create$_handle_response__33382.invoke (core.clj:443)
    muuntaja.core$create$reify__33384.format_response (core.clj:483)
    muuntaja.middleware$wrap_format_response$fn__33446.invoke (middleware.clj:132)
    muuntaja.middleware$wrap_format_negotiate$fn__33439.invoke (middleware.clj:96)
    ring.middleware.keyword_params$wrap_keyword_params$fn__32254.invoke (keyword_params.clj:36)
    ring.middleware.nested_params$wrap_nested_params$fn__32312.invoke (nested_params.clj:89)
    ring.middleware.params$wrap_params$fn__32386.invoke (params.clj:67)
    compojure.api.middleware$wrap_inject_data$fn__34433.invoke (middleware.clj:96)
    compojure.api.routes.Route.invoke (routes.clj:90)
    compojure.core$routing$fn__23893.invoke (core.clj:185)
    clojure.core$some.invokeStatic (core.clj:2674)
    clojure.core$some.invoke (core.clj:2665)
    compojure.core$routing.invokeStatic (core.clj:185)
    compojure.core$routing.doInvoke (core.clj:182)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invokeStatic (core.clj:659)
    clojure.core$apply.invoke (core.clj:652)
    compojure.core$routes$fn__23897.invoke (core.clj:192)
    compojure.api.routes.Route.invoke (routes.clj:90)
    compojure.core$routing$fn__23893.invoke (core.clj:185)
    clojure.core$some.invokeStatic (core.clj:2674)
    clojure.core$some.invoke (core.clj:2665)
    compojure.core$routing.invokeStatic (core.clj:185)
    compojure.core$routing.doInvoke (core.clj:182)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invokeStatic (core.clj:659)
    clojure.core$apply.invoke (core.clj:652)
    compojure.core$routes$fn__23897.invoke (core.clj:192)
    compojure.api.routes.Route.invoke (routes.clj:90)
    clojure.lang.Var.invoke (Var.java:381)
    figwheel_sidecar.components.figwheel_server$possible_endpoint$fn__19876.invoke (figwheel_server.clj:224)
    figwheel_sidecar.components.figwheel_server$handle_static_resources$fn__19856.invoke (figwheel_server.clj:197)
    figwheel_sidecar.components.figwheel_server$handle_index$fn__19847.invoke (figwheel_server.clj:183)
    figwheel_sidecar.components.figwheel_server$handle_figwheel_websocket$fn__19870.invoke (figwheel_server.clj:219)
    figwheel_sidecar.components.figwheel_server$wrap_no_cache$fn__19881.invoke (figwheel_server.clj:239)
    co.deps.ring_etag_middleware$wrap_file_etag$fn__19040.invoke (ring_etag_middleware.clj:94)
    ring.middleware.not_modified$wrap_not_modified$fn__19016.invoke (not_modified.clj:53)
    ring.middleware.cors$handle_cors.invokeStatic (cors.clj:171)
    ring.middleware.cors$handle_cors.invoke (cors.clj:160)
    ring.middleware.cors$wrap_cors$fn__18988.invoke (cors.clj:185)
    figwheel_sidecar.components.figwheel_server$log_output_to_figwheel_server_log$fn__19838.invoke (figwheel_server.clj:143)
    org.httpkit.server.HttpHandler.run (RingHandler.java:115)
    java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    java.util.concurrent.FutureTask.run (FutureTask.java:266)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    java.lang.Thread.run (Thread.java:745)

So the issue seems to be that lein figwheel dev is using lein-figwheel plugin vs start-figwheel! is using figwheel-sidecar

Sorry I didn't know a better title.

@ro6
Copy link

ro6 commented Oct 25, 2018

@willspecht Did you ever get anywhere with this? I'm having the same issue with the latest compojure-api (2.0.0-alpha27), but in a project without Figwheel.

@ro6
Copy link

ro6 commented Oct 25, 2018

@willspecht Did you ever get anywhere with this? I'm having the same issue with the latest compojure-api (2.0.0-alpha27), but in a project without Figwheel.

@willspecht I found a solution for mine. Had to replace https://github.com/frankiesardo/linked with https://github.com/ikitommi/linked due to frankiesardo/linked#8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants