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

Integration test with pedestal-api example #43

Open
oliyh opened this issue Mar 27, 2017 · 3 comments
Open

Integration test with pedestal-api example #43

oliyh opened this issue Mar 27, 2017 · 3 comments

Comments

@oliyh
Copy link
Owner

oliyh commented Mar 27, 2017

As many examples are based on pedestal-api we need to make sure it always works!

@sjolicoeur
Copy link

sjolicoeur commented Nov 19, 2017

@oliyh using: https://pedestal-swagger.herokuapp.com/swagger.json as an endpoint martian doesn't seem to work nor can I get it to work with examples made from Django-rest openAPI

I tried the following in a REPL:

(def m (martian-http/bootstrap-swagger "https://pedestal-swagger.herokuapp.com/swagger.json" 
    {:interceptors (concat martian/default-interceptors [add-json-header])}))
#'user/m
user=> (martian/explore m)
[]
  • Is there a good way to debug this?
  • is there a good way to not make it dependent on route-name or operationId?

@oliyh
Copy link
Owner Author

oliyh commented Nov 19, 2017

Hi,

The first thing that stands out is your JSON header interceptor. Firstly, that shouldn't be required (Martian supports it already, and autodetects usage from the consumes/provides directive on Swagger). Secondly, you wouldn't concat it, as then it will run after the interceptor that actually performs the request. You would want to have it before the request interceptor.

Also you should be using the default interceptors from martian-http rather than martian.core otherwise you won't have an interceptor that performs the request at all! I suggest you look at the interceptors inside martian-http/default-interceptors to see how they build the request up and then process the response.

@oliyh oliyh closed this as completed Nov 19, 2017
@oliyh oliyh reopened this Nov 19, 2017
@oliyh
Copy link
Owner Author

oliyh commented Nov 19, 2017

Sorry I didn't mean to close this issue. Also I notice that what I said above might not apply to the bootstrap phase (but will apply once you get this issue sorted!).

I'll have a closer look at this later unless you manage to solve it in the meantime.

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