With this module, we would be able to query a JSON document and render the details of the JSON through Views.
The JSON data is not stored in the database(except for the cached content), and would be rendered through Views directly.
The JSON data once retrieved (http request) would be cached and used accordingly. There is a settings page ('/admin/config/user-interface/views-json-source-settings') where the cache duration can be configured.
This module extends the core views plugins to be able to interact with the JSON content and render the data as required (as configured in the views).

Similar to Views XML Backend, but works with JSON data.

Project link

https://www.drupal.org/project/views_json_source

Git instructions

git clone --branch 8.x-1.x https://git.drupalcode.org/project/views_json_source.git

PAReview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-views_json_sou...

CommentFileSizeAuthor
#4 13562346.patch70 byteselavarasan r

Comments

venugopp created an issue. See original summary.

avpaderno’s picture

Thank you for applying! I added the Git instructions for non-maintainer users and the PAReview checklist link. Reviewers will check the project and post comments to list what should be changed.

If you haven't done it, yet, please check the PAReview report and fix what needs to be fixed. There could be some false positives; verify that what reported is correct, before making any change.

elavarasan r’s picture

Status: Needs review » Needs work

README.txt file contains some issues related to coding standard.

FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
-------------------------------------------------------------------------------
15 | WARNING | Line exceeds 80 characters; contains 82 characters
48 | WARNING | Line exceeds 80 characters; contains 88 characters
50 | WARNING | Line exceeds 80 characters; contains 84 characters
63 | WARNING | Line exceeds 80 characters; contains 81 characters
68 | WARNING | Line exceeds 80 characters; contains 81 characters
89 | WARNING | Line exceeds 80 characters; contains 83 characters
94 | WARNING | Line exceeds 80 characters; contains 83 characters
103 | WARNING | Line exceeds 80 characters; contains 83 characters
108 | WARNING | Line exceeds 80 characters; contains 83 characters
120 | WARNING | Line exceeds 80 characters; contains 91 characters

elavarasan r’s picture

StatusFileSize
new70 bytes

Apply the below patch file for #3.

venugopp’s picture

Status: Needs work » Needs review

The PAReview issues have been addressed.

shaktik’s picture

Thank you for your contribution!

Review of the 8.x-1.x branch (commit c0ff5c3): looks good to me.

avpaderno’s picture

The task of reviewers is pointing out what needs to be change, not providing patches.

wil2091’s picture

Reviewed 8.x-1.x and looks good to me.

venugopp’s picture

Thank you all for your reviews.
All the problems above have been fixed.
Please review.

wongjn’s picture

General

  • Consider consistent spelling of JSON: I see some instances of Json and JSON throughout.
  • Consider adding tests.

views_json_source.info.yml

  • (+) Dependencies declared as an object/hash, convention is as an array. Instead of
    dependencies:
      views: 'drupal:views'
    

    It should be

    dependencies:
      - 'drupal:views'
    
  • (+) core_version_requirement: ^8 line not needed if the Drupal only supports Drupal 8. This line is for Drupal >=8.7 and 9. Is there any reason why this module couldn't be compatible with Drupal 9?

src/Form/ViewsJsonSourceSettingsForm.php

  • (+) For the cache_ttl form element, one should use '#type' => 'number' for a number field instead of textfield with overridden #attributes.
  • For the cache_ttl form element, consider adding '#min' => 0 as I believe a negative TTL would not make sense in this context.
  • For the cache_ttl form element, consider using an integer for the #size parameter.

config/schema/views_json_source.schema.yml

  • Prefer single quotes over double quotes for strings

Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

wongjn’s picture

Status: Needs review » Needs work
venugopp’s picture

Status: Needs work » Needs review

Thanks the the feedback. The required & recommended changes are pushed to the branch. Please review.

avpaderno’s picture

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.