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
11
votes
1 answer

What is the best way to map REST URL Patterns to Model Objects for the Siesta framework?

I'd like to use a ResponseTransformer (or a series of them) to automatically map my object model classes to the responses coming back from a Siesta service so that my Siesta resources are instances of my model classes. I have a working…
annicaburns
  • 215
  • 1
  • 8
10
votes
1 answer

How to implement a Persistent Cache in Siesta with a structured model layer

I'm using (and loving) Siesta to communicate with a REST web service in my Swift App. I have implemented a series of ResponseTransformers to map the API call responses to model classes so that the Siesta Resources are automatically parsed into…
annicaburns
  • 215
  • 1
  • 8
5
votes
2 answers

How can I mock resource responses?

In my app I have a class that encapsulates a Service and has methods that return resources and requests. In my tests I want to mock success/failures for the requests and resources without making any real network calls.Since Request is a protocol, it…
4
votes
2 answers

Sending a numeric value in http request with swift, adds 000000000000001 to the actual value

I'm trying to perform a HTTP request to a server: the content is a JSON object, which contains a numeric value for the key "amount". If the "amount" is a value with a decimal digit, e.g. 1.6, the request will contain the value 1.6000000000000001,…
AleGiovane
  • 172
  • 1
  • 13
4
votes
1 answer

Siesta iOS GET request with url parameters

Is there a way to make a GET request in Siesta, while providing parameter, like http://example.com/api/list.json?myparam=1? I tried with myAPI.resource("list.json?myparam=1") but the question mark gets escaped. Then I tried…
o15a3d4l11s2
  • 3,969
  • 3
  • 29
  • 40
3
votes
2 answers

How do I upload a file using Siesta Framework in Swift?

The question is pretty straightforward: I need to upload a .zip file to a server, how do I do this within Swift using Siesta Framework? Thank you.
AleGiovane
  • 172
  • 1
  • 13
3
votes
1 answer

Swift Siesta edit fetched entity

I'm building an API client using Siesta and Swift 3 on Xcode 8. I want to be able to fetch an entity using a Siesta resource, then update some of the data and do a patch to the API. The issue is that having an entity, if I save the JSON arrays in my…
SkarXa
  • 1,184
  • 1
  • 12
  • 24
3
votes
1 answer

How do I create a Siesta transformer for an API endpoint that contains a JSON array?

I'm building an app that needs to make a GET request to the API endpoint https://thecountedapi.com/api/counted using the Siesta framework. The endpoint returns a JSON array, just like an endpoint like https://api.github.com/users/ebelinski/repos,…
Eugene
  • 3,417
  • 5
  • 25
  • 49
3
votes
1 answer

Siesta Swift Casting from ImplicitlyUnwrappedOptional to Array

I am configuring ResponseTransformer of siesta to return array of objects. service.configureTransformer("/models/*") { Model.instantiate($0.content) } but somehow when I try to convert them to back to array using let objects =…
user793789
  • 196
  • 1
  • 13
3
votes
1 answer

Does Siesta provide any special handling for pagination?

How does Siesta handle paginated URLs? Is there a mechanism to manage multiple pages of results as a single resource?
Ilias Karim
  • 4,798
  • 3
  • 38
  • 60
2
votes
1 answer

Mark successful siesta response as error

I'm working with a really strange (and nasty) API that I have no control over, and unfortunately when an invalid request is made, instead of responding with a 4xx status, it responds with a 200 status instead. With this response, it also changes the…
PaReeOhNos
  • 4,338
  • 3
  • 30
  • 41
2
votes
1 answer

Siesta Framework Request Cancellation

I could not find any way to cancel a request using Siesta Framework. Is this possible, and how?
o15a3d4l11s2
  • 3,969
  • 3
  • 29
  • 40
2
votes
1 answer

How should I handle partial EntityCache hits in Siesta?

I have an endpoint where I can request multiple pieces of data (such as https://example.com/things?ids=1,2,3) that I'm querying using Siesta. I'm trying to figure out the proper behavior of my persistent entity cache if I only have some of the…
Jordan Wood
  • 2,727
  • 3
  • 12
  • 17
2
votes
1 answer

How to define content transformers in Siesta?

I'm just integrating Siesta and I love it, it solves a lot of issues we have when using frameworks like RestKit. What I can't get my head around is how to use the content transformers? I've looked at the docs and examples and I can't quite…
Camsoft
  • 11,718
  • 19
  • 83
  • 120
2
votes
1 answer

Authentication Token

I'm trying to setup a simple iOS example to better understand Siesta. My REST api requires an access token to accompany each request. So (1) at the start of the app and (2) anytime I retrieve a HTTP 401 I need to request an access token and then…
user2199730
  • 151
  • 1
  • 5
1
2 3 4 5