L
L
loly2017-05-15 19:13:22
JavaScript
loly, 2017-05-15 19:13:22

Is there a ready-made API parser (by template) and how to detect new fields?

Before questions, I think it's necessary to mention a few things about the API and the resulting JSON.

  • The API returns pure JSON, errors in it are extremely unlikely.
  • The API follows a certain "pattern" (i.e. it has predefined constant fields).
  • Contrary to the previous paragraph, new fields may appear in this API, which (unfortunately) no one will warn about in advance. After that, they most likely remain forever.

Questions:
  1. Is there a ready-made "parser" for such APIs? After all, the task seems extremely trivial, at the moment I'm doing a normal request, and then JSON.parse (performance matters, maybe this is not the best way?)
  2. How to find these "new fields" (partly this question can be attributed to the first one)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2017-05-15
@vshvydky

There is a json - true parameter in request, which does it right for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question