Questions tagged [spray-dsl]

An open-source toolkit for building REST/HTTP-based integration layers on top of Scala and Akka. It's asynchronous, actor-based, fast, lightweight, modular and testable.

43 questions
2
votes
0 answers

How to make my spray project into a standalone eclipse rcp application?

I created an emf model and also a spray project. I am able to start the spray project over "Run as.." as an eclipse application and i will get an editor that depends on my emf model. Now i would like to integrate this editor into a part of an…
Gizmo
  • 871
  • 1
  • 15
  • 38
1
vote
0 answers

Spray on AWS Bind to localhost/127.0.0.1:80 failed

I have set up everything for spray on my AWS instance. I am also able to run the sample spray-template successfully. But the issue is spray-template uses port 8080 to bind when I change port from 8080 to 80. I am facing below mentioned error. Bind…
Ashwin N Bhanushali
  • 3,872
  • 5
  • 39
  • 59
1
vote
2 answers

Case insensitive parameter parsing in Spray routing

I would like to make parameter parsing in Spray routing case insensitive. For example: val route: Route = { (path("search") & get) { parameters('pagesize.as[Int] ?, 'appId ?) { (pageSize, appId) => ... } } } In this route, I…
Rahul Singhai
  • 1,299
  • 15
  • 27
1
vote
1 answer

Generate documentation for Akka HTTP's(Spray Routing DSL) Route

Is there custom extensions/directives for spray routing DSL/Akka HTTP which allow to generate documentation for given Route instance?
stanislav.chetvertkov
  • 1,620
  • 3
  • 13
  • 24
1
vote
1 answer

Use a Dispatcher with Spray HttpService

My application has an API using SprayCan. In the application, any blocking code has a separate dispatcher for each specific resource. Is it necessary to protect the API service from being blocked by the application by configuring it with it's own…
user2827214
  • 1,191
  • 1
  • 13
  • 32
1
vote
1 answer

Spray: factor out onSuccess directive

I would like to change the following code fragment in a way that I want to factor out the onSuccess block into a new method. JSON marshalling should still work. (patch & parameterMap & asJson) { params => ... val…
Fred4242
  • 31
  • 5
1
vote
1 answer

spray.io debugging directives

I am playing around with spray.io and I am not able to make spray debugging directives logRequestResponse work - I don't see any output in the log. val route: Route = { pathPrefix("city") { pathPrefix("v1") { path("transaction" /…
jaksky
  • 3,305
  • 4
  • 35
  • 68
1
vote
0 answers

Why does spray routing formFields take a val instead of a type

I am trying to set up a basic server using spray routing and would like to use a type to represent one of the forms PUTs. I am using the formFields('some, 'fields).as(Thing) notation as described in the documentation At first glance I assumed .as…
GoldenFish
  • 217
  • 2
  • 9
1
vote
0 answers

spray - validation error of request parameters doesn't result in status code 400 - badRequest

I have following spray route post { parameters(('adId.as[String], 'propertyType.as[TypNe])).as(Import){imp => complete { adImporterService ! imp StatusCodes.Accepted } } …
jaksky
  • 3,305
  • 4
  • 35
  • 68
1
vote
2 answers

Scala symbol to java enum

I am using a spray-routing which is pretty elegant with using symbols for parameters. However I am dealing with some legacy code and need to use java enum. Is there some elegant way how to convert scala symbol to java enum? So the desired code would…
jaksky
  • 3,305
  • 4
  • 35
  • 68
1
vote
1 answer

spray-testkit === status passes whatever status is

I have following test in spray-testkit with scalatest and I do not understand why test passes every time despite the actual status. import akka.actor._ import akka.event.LoggingReceive import akka.testkit.TestProbe import…
jaksky
  • 3,305
  • 4
  • 35
  • 68
1
vote
2 answers

Running simple spray route test result: Could not initialize class spray.http.Uri$

I am fairly new to spray . I am trying to get the testing correctly so I used the example shown in spary testkit however I am getting this errors. any assistance will greatly appreciated : The service should Could not initialize class…
igx
  • 4,101
  • 11
  • 43
  • 88
1
vote
1 answer

Spray Routing not matching HTTP Method correctly

I am using Spray Routing to try to match routes using different HTTP method but when I do a GET request it actually goes through DELETE, PUT and GET. I thought delete and put rejects all requests that are not HTTP DELETE or HTTP PUT. This is my…
hveiga
  • 6,725
  • 7
  • 54
  • 78
1
vote
1 answer

Spray List Marshaller not found

This code results in a compile error of could not find implicit value for parameter marshaller: spray.httpx.marshalling.ToResponseMarshaller[List[akka.actor.ActorRef]]. I don't think the problem is the ActorRef, as changing this to…
Hamy
  • 20,662
  • 15
  • 74
  • 102
1
vote
1 answer

Retrieve list of Strings from Spray path

I have a base url of an API like this http://host/api/categories In my database categories are a tree based model. I'd like to be able to have an api where I can hit urls…
benstpierre
  • 32,833
  • 51
  • 177
  • 288