Skip to content

Instantly share code, notes, and snippets.

@AgniveshChaubey
Last active January 21, 2024 10:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AgniveshChaubey/3935e130d65ebe02cc60fd95c8273091 to your computer and use it in GitHub Desktop.
Save AgniveshChaubey/3935e130d65ebe02cc60fd95c8273091 to your computer and use it in GitHub Desktop.

Google Summer of Code Final Report


This page demonstrates the project work titled "Bowtie and the World of JSON Schema" during Google Summer of Code, 2023 under Postman.

Overview:

  • Organization: JSON Schema (under Postman)
  • Project: Bowtie and the World of JSON Schema
  • Contributor: Agnivesh Chaubey (agniveshvapi@gmail.com)
  • Mentor: Julian Berman
  • Co-Mentors: Benjamin Granados, Pranav Singhal

About Project:

JSON Schema is a vast field with tools available in various programming languages. These tools serve different purposes, like data validation. However, ensuring full compliance with the JSON Schema specifications can be challenging. As a user, it's essential to comprehend potential deviations in implementations to make informed choices regarding tools or contribute to improvements. Bowtie is a tool designed to help with this.

Bowtie acts as a meta-validator for JSON Schema. It coordinates different validator implementations, gathers and reports their results. It employs a straightforward input/output protocol, allowing validators to implement it. It assesses the compliance of different JSON Schema tools by testing them against a set of known accurate cases and presenting the results on a web page regularly. Bowtie offers a command-line interface for running supported implementations. See documentation for more details.


Contributions:

PR Link Description Status
#189 Added runtime information to the implementation harness' metadata Merged
#225 Added smart theme toggling feature to Bowtie report (UI) using Bootstrap Merged
#241 Added a dynamic (React-driven) UI to replace the statically generated one Merged
#297 Added a feature to upload locally generated reports to Bowtie UI Merged
#316 Added support for the networknt library - a Java-based implementation Merged
#350 Added support for the opis library - a PHP-based implementation Open
#397 Added implementation-specific page to the Bowtie UI Open
#404 Added a button to Bowtie UI to access its documentation page Merged
#278, #326, #344 Bug Fixes Merged

Detailed Explanation:

Week 1-2:

In the first two weeks, I primarily focused on the UI part of the project.

  • Created a user-friendly UI for visualizing validation reports using JavaScript.
  • Initially built a single-page UI and later rebuilt it using React.js.
  • Received invaluable guidance and feedback from Julian (mentor) and Harrel (community menmber).
  • Focused on adding remaining components to the UI.
  • Overcame challenges involving SVG icon rendering and Bootstrap's modal component.
  • Emphasized the importance of persistence and learning in problem-solving.
  • Completed the basic UI features and prepared for deployment.

By the end of these two weeks, I had made significant progress. The foundational features of the UI were nearly complete, setting the stage for deployment in the coming weeks.

Week 3-4:

During these weeks, the user interface (UI) was almost ready for deployment. However, a significant hurdle emerged when we planned to host the application on GitHub Pages. React Router's BrowserRouter clashed with GitHub Pages due to incompatible history APIs. To tackle this, I turned to HashRouter, which GitHub Pages supports as it doesn't rely on those APIs. It's worth noting, though, that HashRouter isn't SEO-friendly like BrowserRouter. Also, I switched to createHashRouter as it brings enhanced performance and data API support introduced in React Router 6.4.

  • Switched to createHashRouter instead of HashRouter due to GitHub Pages compatibility.
  • Embraced loader functions to fetch data for components.
  • Explored async/await for managing asynchronous code execution.
  • Implemented React's Context API for streamlined data sharing.
  • Introduced a user-friendly feature for uploading local data.
  • Incorporated loading animation for improved UX.
  • Enhanced code organization and efficiency across multiple components.

In summary, these weeks presented challenges and insights. I tackled compatibility issues, embraced async/await, harnessed Context API, and introduced new features.

Week 5-6:

After completing frontend tasks, I embraced the challenge of backend development. I worked on a Java-based implementation (networknt) in Bowtie. This task presented an opportunity to contribute to Bowtie's backend and learn about the implementation harness.

  • Invested time in understanding Java's concepts and syntax, given its newness to me.
  • Explored the Networknt library, the platform for schema validation implementation.
  • Grasped Bowtie's Input Harness Output Protocol (IHOP) significance.
  • Bowtie communicates with the backend via IHOP, using standard input and output for requests and responses.
  • Gained a key understanding of initial request and response schemas to confirm backend readiness.
  • Faced challenges like unresolved schemas and references.
  • Leveraged community support to address these issues.
  • Created a Java-based harness, tackled problems, and incorporated mentor's feedback.
  • Successfully merged my harness into the project.
  • Acknowledged that creating the harness took longer than anticipated, which is normal for a first-timer.

Moving from Bowtie's frontend to backend was enriching. I gained insights into Java, backend implementation, and harness creation.

Week 7:

Mid-term evaluation period.

Week 8-10:

In this phase, I started working on adding support for the 'Opis Library' - a PHP-based JSON schema validator. However, the challenges I encountered along the way prompted a shift in focus as deadlines approached. Here's a breakdown of the key tasks during this period:

  • Immersed myself in PHP, gaining familiarity with its syntax and functions.
  • Explored the Opis library, an essential JSON schema validator for PHP.
  • Developed the initial iteration of the harness, laying the groundwork for further enhancements.
  • Submitted the initial PR for review, seeking feedback from the mentor.
  • Acted upon the feedback received after the initial review, refining the harness accordingly.
  • Despite improvements, encountered persistent issues with the harness functionality.
  • With deadlines imminent and discussions highlighting unfinished tasks, I temporarily shifted focus.
  • Redirected my attention to the UI realm, temporarily halting PHP harness work.
  • Kicked off by designing a mock Figma representation, establishing a baseline for further iterations.
  • Engaged in iterative discussions with Julian, iterating on the design to align with project objectives.

In short, during these weeks, I focused on creating the harness and wireframe for the new features in the UI.

Week 11-12:

During this phase, I focused on translating the discussed design into actual implementation. In this time, I also had exams, so I dedicated some time there as well.

  • Began the implementation of the discussed design.
  • Created the /<lang>-<implementation> path with foundational content.
  • Expanded content in /<lang>-<implementation>/dialects/<dialect-name> path.
  • Submitted a PR for community review, seeking valuable insights.
  • Received suggestions during the PR review process.
  • Adapted my approach to focus on one task at a time, refining code accordingly.
  • Engaged in multiple iterations to enhance the implementation and address feedback.
  • Approaching the final stages of merging the PR.
  • Managed academic commitments during college exams, balancing both responsibilities.

GSoC and Its Importance

Google Summer of Code (GSoC) stands as a pivotal program that bridges the gap between aspiring open-source contributors and industry-expert developers. It provides an impactful platform for students to immerse themselves in real-world projects, all under the nurturing guidance of experienced mentors. The exposure that GSoC offers is truly invaluable, granting newcomers the opportunity to immerse themselves in the collaborative realm of open source and actively contribute to meaningful projects such as Bowtie. I am profoundly grateful for the chance I received to serve as a GSoC contributor, a journey that enriched my knowledge and skills under the guidance of my mentors and fellow community members.

In conclusion, GSoC is a transformative journey that propelled me into the expansive world of open source, facilitating my growth both technically and professionally. It has cultivated within me the spirit of contribution and collaboration, virtues highly esteemed within the software industry. My commitment to this community remains unwavering; I intend to sustain my involvement well beyond GSoC, actively contributing to the project's evolution and success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment