question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How do I create different success.json based on a param?

See original GitHub issue

I have not yet figured this one out and need help.

Folder structure:

test#{id}

test#{id}/GET

test#{id}/GET/mock

Example: Call: /rest/test/1 Response should be:

{
      "id": 1,
      name: "John"
}

Call: /rest/test/2 Response should be:

{
      "id": 2,
      name: "Sven"
}

Edit. Also i don’t figure out how to show error.json if no ID is supplied when doing the GET.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JonWallstencommented, Apr 7, 2016

And as a feature request it would be cool if you could use different success files for different params. Like success{id}.json and the you name the files success1.json, success2.json, and so on!

0reactions
JonWallstencommented, Apr 8, 2016

Thank you! That’s awesome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create, and handle parameters and success response ...
//now create the URLRequest object using the url object var ... httpBody = try JSONSerialization.data(withJSONObject: params, options: .
Read more >
How To Work with JSON in JavaScript - DigitalOcean
This tutorial provides an introduction to working with JSON in JavaScript. Some general use cases of JSON include: storing data, ...
Read more >
Response.json() - Web APIs - MDN Web Docs
The json() method of the Response interface takes a Response stream and reads it to completion. It returns a promise which resolves with...
Read more >
JSON - Quick Guide - Tutorialspoint
JSON - Quick Guide, JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange.
Read more >
JSON:API — Latest Specification (v1.1)
A client MAY use the profile media type parameter in an Accept header to request that the server apply one or more profiles...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found