Questions tagged [siesta-swift]

Use [siesta-swift] for questions about the Siesta REST library for iOS. For the Javascript unit testing tool, use the tag [siesta].

Siesta is a REST framework for iOS apps. It provides a resource-centric alternative to the familiar request-centric approach to networking.

67 questions
1
vote
1 answer

How do I access an image URL that's not in the list JSON for my API in my Siesta Resource?

I'm using Siesta with an API that returns a very lightweight list response for root entities. For instance, for /entity this is what the response looks like: { count: 200, results: [ { url: "https://example.com/api/entity/1/", name:…
Brent Schooley
  • 782
  • 1
  • 6
  • 20
1
vote
0 answers

How to bind custom nib view to Siesta ResourceStatusOverlay public outlets

I've created a custom view in Interface Builder and set the File's Owner to ResourceStatusOverlay. I would like to bind subviews from the .xib to ResourceStatusOverlay @IBOutlet. I've tried dragging the connections from .xib to…
Jaime Baez
  • 33
  • 6
1
vote
1 answer

Can I use SwiftyJSON to get at error contents in Siesta?

I'm writing a test for my Siesta-based class, and I'm trying to access the error I received from the server. In my object, I configured the service like so: self.service.configure { …
Jordan Wood
  • 2,727
  • 3
  • 12
  • 17
1
vote
1 answer

Response transformer exceptions

With the service I'm working with, most of the responses are in XML, but a few are plain text. What's the best way to set that up? Currently I have this: // Root should return plain text, don't try to transform it configureTransformer("/") {…
Uncommon
  • 3,323
  • 2
  • 18
  • 36
1
vote
1 answer

Swift Siesta and NSURLSession

Looking for a way to still use an NSURLSession but override the siestaNetworkingProvider implementation to return my own NetworkingProvider. This seems impossible however since you can not override protocol extensions.
MPiccinato
  • 101
  • 1
  • 5
1
vote
1 answer

Siesta handling multiple requests

I have a loop where I POST requests to the server: for (traineeId, points) in traineePointsDict { // create a new point let parameters: NSDictionary = [ "traineeId": "\(traineeId)", "numPoints": points, …
Rhuantavan
  • 445
  • 3
  • 17
0
votes
1 answer

Siesta Service configureTransformer for URL decode models based upon parameters

I have an endpoint which supports post requests. The URL is the same for all requests but the parameters will be different for each request. It is basically a free-form query service when the client can formulate the query and fields that will be…
0
votes
1 answer

How do I declare the Siesta Swift package as a dependency of another Swift package?

I'm trying to use the Swift package Siesta as a dependency for the package I'm building and reference it in my package code. I've identified how to import the package into my project in my Package.swift file which is simple enough: dependencies: [ …
user547414
0
votes
1 answer

Swift Siesta - How to include asynchronous code into a request chain?

I try to use Siesta decorators to enable a flow where my authToken gets refreshed automatically when a logged in user gets a 401. For authentication I use Firebase. In the Siesta documentation there is a straight forward example on how to chain…
manban
  • 133
  • 1
  • 19
0
votes
1 answer

How to override default ("**") decorator for certain resource in siesta?

I'm trying to use Siesta swift package with my API on the server. We've setup a JWT authentication with Access and Refresh tokens. We can successfully authenticate and get new access tokens with refresh procedure. But the solution we've made looks a…
Roman Savrulin
  • 183
  • 1
  • 6
0
votes
0 answers

Storing credentials with Siesta framework - iOS

Wanted to give to Siesta a try and I've started using it within a side project. I was wondering if any of you have got any advice about storing the login credentials (either username+psw or just the token) and how these have been integrated within…
Dario
  • 109
  • 1
  • 8
0
votes
1 answer

Siesta configureTransformer for Resource with parameters

I'm trying to configure a transformer for an endpoint with parameters. I successfully configured transformers for endpoints that don't include any parameters. But it seems that when I try to do the same for Resource with parameters it won't…
Omega
  • 61
  • 5
0
votes
3 answers

Siesta JSON Response

I have set up an API that gives a JSON response as follows: { "key1": "success", "key2": { "int_val": 5, "str_val": "email", } } I've read this, yet still do…
nonamorando
  • 1,556
  • 2
  • 14
  • 33
0
votes
0 answers

When using Siesta to make an API post, the request method is returning a "Cannot parse server response" error

I am having issues parsing the response from an API call using Siesta for iOS. After I post the JSON, it fails trying to parse the response. resource("/SaveEmailAddress").request(.post, json: SaveEmailAddress.toDictionary()).onSuccess { (entity)…
ajburt
  • 1
  • 1
0
votes
1 answer

Override Local Data in Siesta?

I'm having trouble successfully setting local data for Siesta in Swift. My goal is to set a UIImage for a URL locally, so that this local image can be displayed with no download time. To do this, I'm setting the image data for the URL as such: let…
MQLN
  • 2,292
  • 2
  • 18
  • 33