-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of nested JSON responses #34
Comments
At the time I tried to make this work but found it impossible, I don't remember exactly what the problem with the commas was. The closest thing to the result you need would be to use The bad: it doesn't work right now (but I think it's an easy fix). Here is how it would look: ```req
url: https://urlscan.io/api/v1/search/?q=page.url:www.google.com&size=1
req-id: 12
disabled
show: results -> {..} -> task -> time
```
```req
req-id: 12
disabled
show: results -> {..} -> page -> url & title & tlsValidFrom & tlsValidDays & tlsAgeDays & tlsIssuer
```
```req
req-id: 12
show: results -> {..} -> result & screenshot
disabled
``` |
I think that is a fine solution if the req-id's can be defined dynamically like I mentioned in #29 It would allow for flexibility when working with the response. You do one request and then have the option of working with parts of the response where you need it. For example you could always create the request block at the start of the file, even have a few requests with different req-id's (variable for the filename and some indicator of what the request is). Then you follow it with a few blocks to pull data from those to add to the file properties if needed. Then you add blocks for specific data from the request to display along with the rest of the markdown text in the file. |
This plugin is like an amalgamation of code; it has more bugs than features, but for some reason it works. I've been thinking about rewriting it all, but lately I haven't had the time to do it. |
I know that feeling well, you start by super gluing code parts to get the original use case working and then it evolves into a monster of both horrors and potential :) |
Hey @elvarb I will come back later and explain but I ran into this issue today I have this for my show mine and it worked. so wouldn't this work? |
Is your feature request related to a problem? Please describe.
As it stands the plugin allows to iterate through the response json if it contains an array. But if the response json contains multiple arrays or a mix of arrays and normal values you can not get data from both.
For example the response from the urlscan.io search api
Returns
If I want to get the information on the scan date and details from the page I can not do both as the show function only allows for one {..} iteration at a time meaning to get the information I want I have to have three requests to the API.
Describe the solution you'd like
Allow for comma to be used as you can normally when not working with an array.
Describe alternatives you've considered
Multiple req blocks, as shown above is the only workaround I can see. In some cases that would be ok, but in others that is not optimal and sometimes it could mean you are getting different results from the api for each request.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: