Giter Club home page Giter Club logo

Comments (6)

hellogerard avatar hellogerard commented on August 28, 2024

Yeah the format is correct. To make it easier to read, try a JSON formatted
extension, like this one:
https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en

Postman is quite popular:
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en

Cheers.

On Friday, March 14, 2014, Scott Deeter [email protected] wrote:

I am working on getting an API going for my app and have managed to get an
endpoint successfully returning JSON. The problem is, it appears to be
serialized--all the line breaks and newlines have been stripped from it. Is
there a way to get it to output more-readable JSON?

Reply to this email directly or view it on GitHubhttps://github.com//issues/12
.

Sent from my mobile device.

from reststop2.

shrop avatar shrop commented on August 28, 2024

I submitted the pull request #13 as an idea to have reststop2 output pretty out of the box. Maybe this could even be a setting, but I don't know how to handle settings for Meteor smart packages.

I based this on the way github's API prettifies JSON output with 2 space indentions.
See example: https://api.github.com/events

Thanks for considering the pull request.

from reststop2.

shrop avatar shrop commented on August 28, 2024

duh, I realized reststop2 already has some settings. I added 'pretty_json' as a new setting in the existing pull request.

from reststop2.

hellogerard avatar hellogerard commented on August 28, 2024

Thanks @shrop for the PR. Merged this in. Should make it in next release.

I've defaulted pretty_json to false. This is a bit of personal opinion, but I don't think results should be formatted for humans, since they're intended for machines. For the paranoid, formatting adds unnecessary data in the form of carriage returns and spaces to the response. I believe it burden should be on the human to make it readable, by using an extension (or now setting the config).

Cheers.

from reststop2.

shrop avatar shrop commented on August 28, 2024

Excellent! I defaulted it to false and forgot to push that up. I totally agree. Thanks!

from reststop2.

deetergp avatar deetergp commented on August 28, 2024

Fantastic! Thanks for sorting this out.

from reststop2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.