Fork me on GitHub
#yada
<
2020-02-28
>
Danny Almeida02:02:19

Hi, I'm trying out the examples on the yada manual... everything works, but when the server returns an error, it also returns the whole ctx map in the response. Is this normal ? curl -i HTTP/1.1 400 Bad Request Content-Length: 3750 Content-Type: text/plain;charset=utf-8 Server: Aleph/0.4.4 Connection: Keep-Alive Date: Fri, 28 Feb 2020 02:44:22 GMT {:ctx {:response {:headers {}}, :request {:aleph/request-arrived 23639847996759, :aleph/keep-alive? true, :remote-addr "127.0.0.1", :params nil, :route-params nil, :headers {"host" "localhost:3000", "user-agent" "curl/7.58.0", "accept" "*/*"}, :server-port 3000, :uri "/hello-parameter", :server-name "localhost", :query-string nil, :body << stream: {:pending-puts 0, :drained? false, :buffer-size 0, :permanent? false, :type "netty", :sink? true, :closed? true, :pending-takes 0, :buffer-capacity 16384, :connection {:local-address "localhost/127.0.0.1:3000", :remote-address "/127.0.0.1:35430", :writable? true, :readable? true, :closed? false, :direction :inbound}, :source? true} >>, :scheme :http, :request-method :get}, :request-id #uuid "069133e0-4570-454d-a7d8-725cfebdbca2", :method :get, :known-methods {:* #object[yada.methods.AnyMethod 0x8fca017 "yada.methods.AnyMethod@8fca017"], :head #object[yada.methods.HeadMethod 0x30cb5b0f "yada.methods.HeadMethod@30cb5b0f"], :get #object[yada.methods.GetMethod 0x49f4426b "yada.methods.GetMethod@49f4426b"], :put #object[yada.methods.PutMethod 0x36d66e30 "yada.methods.PutMethod@36d66e30"], :post #object[yada.methods.PostMethod 0x4c8b01d9 "yada.methods.PostMethod@4c8b01d9"], :delete #object[yada.methods.DeleteMethod 0xdeeec59 "yada.methods.DeleteMethod@deeec59"], :options #object[yada.methods.OptionsMethod 0x75204dae "yada.methods.OptionsMethod@75204dae"], :trace #object[yada.methods.TraceMethod 0x7a519d8e "yada.methods.TraceMethod@7a519d8e"]}, :interceptor-chain [#function[yada.interceptors/available?] #function[yada.interceptors/known-method?] #function[yada.interceptors/uri-too-long?] #function[yada.interceptors/TRACE] #function[yada.interceptors/method-allowed?] #function[yada.swagger-parameters/parse-parameters] #function[yada.interceptors/capture-proxy-headers] #function[yada.cookies/consume-cookies] #function[yada.security/authenticate] #function[yada.interceptors/get-properties] #function[yada.security/authorize] #function[yada.interceptors/process-content-encoding] #function[yada.interceptors/process-request-body] #function[yada.interceptors/check-modification-time] #function[yada.interceptors/select-representation] #function[yada.interceptors/if-match] #function[yada.interceptors/if-none-match] #function[yada.interceptors/invoke-method] #function[yada.interceptors/get-new-properties] #function[yada.interceptors/compute-etag] #function[yada.security/access-control-headers] #function[yada.security/security-headers] #function[yada.interceptors/create-response] #function[yada.interceptors/logging] #function[yada.interceptors/return]], :uri-info #function[bidi.vhosts/find-handler/fn--24244/fn--24252], :allowed-methods #{:get :head :options}, :method-wrapper #object[yada.methods.GetMethod 0x49f4426b "yada.methods.GetMethod@49f4426b"], :yada.context/cache #<Atom@5cc75ff9: {}>, :id #uuid "192d1f01-9db0-4479-8287-eab1730d537d", :resource {:methods {:get {:response #function[example.hello.core/eval55640/fn--55641/fn--55642], :produces [{:media-type {:name "text/plain", :type "text", :subtype "plain", :parameters {}, :quality 1.0}}], :parameters {:query {:p java.lang.String}}}}, :show-stack-traces? true}, :error-interceptor-chain [#function[yada.security/access-control-headers] #function[yada.interceptors/create-response] #function[yada.interceptors/logging] #function[yada.interceptors/return]]}, :status 400, :errors ([:query {:error {:p missing-required-key}}])}

jaihindhreddy07:02:40

Slack tip: use triple backticks for multiline code snippets.

Danny Almeida08:02:21

Sorry ..didn't know about triple backticks. Thank you for the information