Skip to content
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

✨ Enhancement: Proposal: Interactive Code Editor Integration with JSON Schema Validator #1221

Closed
abhayymishraa opened this issue Dec 28, 2024 · 6 comments
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature. Status: Triage This is the initial status for an issue that requires triage.

Comments

@abhayymishraa
Copy link
Contributor

Is your feature request related to a problem? Please describe

Users currently need to switch between our platform and external code editors to test and validate their code. This context-switching disrupts their workflow and learning experience, making it less efficient to experiment with and debug code while using our platform's resources.

Describe the solution you'd like

Implement an integrated code editor accessible via an 'Editor' button in the navigation bar. Key features would include:

  • In-browser code editing with syntax highlighting
  • Real-time code validation and error detection
  • Support for multiple programming languages
  • Easy-to-use interface similar to popular JSON editors
  • Ability to save and load code snippets
  • Direct integration with our platform's existing features

The editor would open in a dedicated workspace, allowing users to write, test, and validate code without leaving our website.

Describe alternatives you've considered

  1. Embedding existing third-party code editors like CodeMirror or Ace Editor
  2. Creating links to recommended external IDEs
  3. Providing code validation through API endpoints only, without a visual editor
  4. Adding a simpler code formatting tool instead of a full editor

Each alternative was considered less optimal as they either don't provide the seamless experience we're aiming for or require additional maintenance overhead.

Additional context

  • This feature would significantly enhance user experience and engagement
  • Similar features have proven successful on platforms like CodePen and JSFiddle
  • Initial implementation could focus on most-used languages first
  • Could potentially integrate with our existing user authentication system for saving code snippets
  • Would reduce support requests related to code validation issues

Are you working on this?

Yes

@abhayymishraa abhayymishraa added Status: Triage This is the initial status for an issue that requires triage. ✨ Enhancement Indicates that the issue suggests an improvement or new feature. labels Dec 28, 2024
@jdesrosiers
Copy link
Member

We've talked about this before and there are several reasons we haven't done it. There are already quite a few of this kind of tool available online. For example, I maintain https://json-schema.hyperjump.io. It wouldn't be hard to link to that or any one of several similar tools or build something similar into the website. We haven't because we don't want to play favorites. What we could do is link to the tools page with filters to list all the online tools and let users pick one they want to use.

You seem to have some misunderstandings of what JSON Schema is, how the ecosystem works, and the functionality of the website. So, parts of this proposal don't make sense. However, we can leave it open if people want to discuss alternatives.

@gregsdennis
Copy link
Member

Providing code validation through API endpoints only

In particular, this one is a concern for me. Our site is static, which means we have no backend infrastructure with which to host an API. Doing so would add a significant cost.

This limitation leads to any potential solution to the in-page validator: it needs to run in the browser.

Finally, I'd like to echo @jdesrosiers' sentiments in that we don't want to play favorites by identifying any particular library as THE library of choice. Most people would see that as an endorsement over other libraries.

@abhayymishraa
Copy link
Contributor Author

Thank you @jdesrosiers and @gregsdennis for the detailed feedback. I understand the concerns about library endorsement and static site limitations. What if we implemented a minimal, pure JavaScript validation solution that:

  1. Runs entirely in the browser (no backend needed)
  2. Uses no external validation libraries (avoiding ecosystem preferences)
  3. Provides basic JSON Schema validation for learning purposes
  4. Includes clear disclaimers that this is a learning tool, not a production validator
  5. Links to the comprehensive tools page for serious validation needs

This could serve as a lightweight learning aid while still encouraging users to explore the full ecosystem of validation tools. Would love to get your thoughts on this approach.

@gregsdennis
Copy link
Member

We have plenty of tools that provide their own playgrounds. I would much rather promote those.

Also, combined with our Tour site, I don't think this is needed.

@abhayymishraa
Copy link
Contributor Author

Ah, now I understand the concerns better! Thank you for taking the time to explain the reasoning behind this. I'm looking forward to contributing to other aspects of the website that might need attention. Would love to hear if you have any suggestions for areas where help would be most valuable?

@jdesrosiers
Copy link
Member

Sounds like this can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature. Status: Triage This is the initial status for an issue that requires triage.
Projects
None yet
Development

No branches or pull requests

3 participants