基于 GUI 或基于 Web 的 JSON 编辑器,其工作方式类似于属性资源管理器

发布于 2024-09-12 06:43:53 字数 1611 浏览 2 评论 0原文

背景:这是对可能尚不存在的东西的请求,但我长期以来一直想构建一个。首先我会问是否有人见过类似的东西。

假设您有一个如下所示的任意 JSON 结构:

{
    'title_str':'My Employee List'
    ,'lastmod_str': '2009-June-15'
    ,'employee_table':[
        {'firstname':'john','lastname':'doe','age':'33',}
        ,{'firstname':'jane','lastname':'doe','age':'34',}
        ,{'firstname':'samuel','lastname':'doe','age':'35',}
    ]
}

问题:是否有一个基于 Web 的 JSON 编辑器可以采用这样的结构,并自动允许用户在用户友好的 GUI 中修改它?

示例:想象一个自动生成的 HTML 表单,其中显示 title 和 lastmod 的 2 个输入类型文本控件,以及 arr_list 的一个包含三列三行的输入类型文本控件表。 .. 能够通过单击表中每行旁边的 [+][X] 来删除或添加其他行。

大创意:这背后的“大创意”是用户能够指定任意(非递归)JSON 结构,然后还能够通过基于 GUI 的交互来编辑该结构(这类似于 XML Spy 中的“XML 编辑器网格视图”)。

另请参阅:

更新:(Thu 2014-07-31 18:31:11)

已经创建了一个 github 存储库来进一步跟踪这个已关闭的 SO 帖子。

Background: This is a request for something that may not exist yet, but I've been meaning to build one for a long time. First I will ask if anyone has seen anything like it yet.

Suppose you have an arbitrary JSON structure like the following:

{
    'title_str':'My Employee List'
    ,'lastmod_str': '2009-June-15'
    ,'employee_table':[
        {'firstname':'john','lastname':'doe','age':'33',}
        ,{'firstname':'jane','lastname':'doe','age':'34',}
        ,{'firstname':'samuel','lastname':'doe','age':'35',}
    ]
}

Question: Is there a web-based JSON editor that could take a structure like this, and automatically allow the user to modify this in a user-friendly GUI?

Example: Imagine an auto-generated HTML form that displays 2 input-type-text controls for both title and lastmod, and a table of input-type-text controls with three columns and three rows for arr_list ... with the ability to delete or add additional rows by clicking on a [+][X] next to each row in the table.

Big Idea: The "big idea" behind this is that the user would be able to specify any arbitrary (non-recursive) JSON structure and then also be able to edit the structure with a GUI-based interaction (this would be similar to the "XML Editor Grid View" in XML Spy).

See also:

Update: (Thu 2014-07-31 18:31:11)

A github repository has been created to further track this closed SO post.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光清浅 2024-09-19 06:43:53

更新:为了回答我自己的问题,以下是我迄今为止所发现的内容。如果其他人有什么东西,我仍然有兴趣了解更多信息。

< strong>基于 JSON 架构

商业(没有意图或暗示的认可,可能满足也可能不满足要求)

jQuery

YAML

另请参阅

Update: In an effort to answer my own question, here is what I've been able to uncover so far. If anyone else out there has something, I'd still be interested to find out more.

Based on JSON Schema

Commercial (No endorsement intended or implied, may or may not meet requirement)

jQuery

YAML

See Also

油饼 2024-09-19 06:43:53

通常,当我想要创建 JSON 或 YAML 字符串时,我首先构建 Perl 数据结构,然后对其运行简单的转换。您可以在 Perl 数据结构生成之前放置一个 UI,例如 Web 表单。

将结构转换为 JSON 非常简单:

use strict;
use warnings;
use JSON::Any;

my $data = { arbitrary structure in here };
my $json_handler = JSON::Any->new(utf8=>1);
my $json_string = $json_handler->objToJson($data);

Generally when I want to create a JSON or YAML string, I start out by building the Perl data structure, and then running a simple conversion on it. You could put a UI in front of the Perl data structure generation, e.g. a web form.

Converting a structure to JSON is very straightforward:

use strict;
use warnings;
use JSON::Any;

my $data = { arbitrary structure in here };
my $json_handler = JSON::Any->new(utf8=>1);
my $json_string = $json_handler->objToJson($data);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文