Skip to content

martian.cljs-http/bootstrap-openapi sets incorrect :api-root value #216

@enspritz

Description

@enspritz

Using martian-cljs-http and martian-re-frame. Discovered this upgrading from martian 0.1.16 to 0.1.30.

(martian.re-frame/init "/rest/openapi.json")

fetches and parses the OpenAPI document, storing the result in re-frame's :db. Upon inspecting the re-frame :db, the :api-root value appears incorrect:

{:db
 {:martian.re-frame/martian
  {:martian.re-frame/default-id
   {:m
    {:api-root ":///rest/" ...

All subsequent attempts to use the REST API through martian fail, due to HTTP requests sent to the wrong URL, such as:

/wherever/the/calling/document/resides.html/%3a///rest/some-call

If %3a// is interpreted as an encoded URL, that would be ://, the same as in the erroneous :api-root value.

Skimming over the sources, martian.openapi/base-url looks of interest...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions