Git Product home page Git Product logo

atom-json-editor's Introduction

atom-json-editor package

Creates UI for json files created along their schemes.

Based on JSONEditor by Jeremy Dorn

A screenshot of atom-json-editor

Usage

atom-json-editor tries to build a UI for a file every time you switch to a tab containing a .json file. The resulting JSON data is automatically saved on change.

Schemes must follow the json-schema specs for proper validation.

Adding custom schemes

By default, some basic schemes are included with the package. Add your own schemes to build .json files in your own format

Schemes are picked by name conversion

Any scheme should have the file extension .schema.json. Any .json file containing it's filename is validated against it.

As an example package.json is validated against package.schema.json. As would any-prefix.package.json.

Using Schemes in your Working Directory

Available since 0.4.0, with thanks to DimShadoWWW

First of all, atom-json-editor will check if there is a valid .schema.json-File inside your current working directory. This means that a File inside ~/anywhere/file.json will be validated against ~/anywhere/file.schema.json if available.

If no valid schema is found inside your working directory, atom-json-editor will continue searching in your Schemes Directory.

Using your own Schemes Directory

Within the package settings choose atom-json-editor. The only option available by now is Schemes Directory. Set it to an (absolute) path where your schemes are stored.

If a scheme isn't found in your Schemes Directory, atom-json-editor will try to get one from it's package library.

Adding schemes to the package library (deprecated)

You can also add schemes directly to the package library by moving them into ~/.atom/packages/atom-json-editor/lib/schemes/.

Note that schemes added to the package library may be replaced when updating this package.

Known issues

A JSON file is open while installing the package

If a JSON file is open while installing the package, you have to de- and reselect the file's tab to start the editor.

atom-json-editor's People

Contributors

bennypowers avatar dimshadowww avatar lukashechenberger avatar noynek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

atom-json-editor's Issues

Sidebar size

Why is it not possible to resize the Json Editor Sidebar?

It seems not to work.

Hi,
Tried on this file, the toggle menu is not showing the form.

Atom: latest
Platform: Kubuntu 14.04 LTS.

Thank for your time,

R

======================== FILE BELOW ==========================

{
"title": "Person",
"type": "object",
"id": "person",
"properties": {
"name": {
"type": "string",
"description": "First and Last name",
"minLength": 4
},
"age": {
"type": "integer",
"default": 21,
"minimum": 18,
"maximum": 99
},
"gender": {
"type": "string",
"enum": [
"male",
"female"
]
}
}
}

editor eliminates zeroes

Great tool! But the following isn't quite working right...

Schema:
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"x": {"type":"number"},
"y": {"type":"number"},
"z": {"type":"number"}
},
"required": ["x", "y", "z"]
}

JSON data:

{
"x": 1,
"y": 0,
"z": 0
}

...and then it complains that x and y are missing.
Maybe better to have an explicit "undefine" button next to the property?

cheers

Sjoerd

Package is not creating a UI

I've been trying to use the package and make a UI by making an example file "package.json" in order to use the example schema but the UI does not build. The readme is vague and unhelpful in figuring out what I need to do to build the UI or if there's a bug.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Required empty string is removed

Hi,

I currently have the problem that I want to define a required string property with empty default value like ""

test.schema.json

{
    "definitions": {},
    "type": "object",
    "title": "Test Schema",
    "required": [
        "test"
    ],
    "properties": {
        "test": {
            "type": "string",
            "default": ""
        }
    }
}

test.json

{
    "test": ""
}

atom-json-editor now remove the property "test" and throws the error

Object missing the required property 'test'

, but I want to allow empty strings. I also tried using a regex pattern but no success. :(

Online JSON Schema validators said that this should be valid.

Am I doing something wrong or is this a problem in atom-json-editor?

Thank you and best regards :)

Ajax option to true

I've installed the package and when attempting to edit a JSON file with a schema, I receive the message, "Must set ajax option to true to load external ref"..... not sure if that's with this package or my schema. Any advice?

$refs in schema don't work

thing.schema.json:

{
    "title": "thing schema",
    "type": "object",
    "properties": {
        "id": {
            "$ref": "id.schema.json"
        }
    },
    "additionalProperties": false
}

Editing a thing:

(path)/thing.schema.json is no valid JSON
Must set ajax option to true to load external ref id.schema.json

Additionally, trying to load "mything.thing.json" initially caused the following error in the console:

Uncaught (in promise) ReferenceError: schemeName is not defined
    at file:///C:/Users/dafta/.atom/packages/atom-json-editor/lib/atom-json-editor.coffee:92:39
    at process._tickCallback (node.js:392:9)

I fixed the error in the following line to unmask the $ref problem.

---          atom.notifications.addError schemeName + ' is no valid JSON',
+++          atom.notifications.addError path + ' is no valid JSON',

please update change log?

would you please update the changelog for your project regularly with each release? we have no idea what are the incremental differences btw. 0.1.0 & 0.4.0, and no info on what is new in 0.4.1, to which i just updated. thank you in advance.

best,

— faddah
portland, oregon, u.s.a.

Uncaught JSON Editor not ready yet. Listen for 'ready' event before getting the value

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.34.0 x64
Electron: 2.0.16
OS: Mac OS X 10.14.2
Thrown From: atom-json-editor package 0.4.1

Stack Trace

Uncaught JSON Editor not ready yet. Listen for 'ready' event before getting the value

At /Users/pepe/.atom/packages/atom-json-editor/lib/deps/jsoneditor.min.js:7

undefined

Commands

Non-Core Packages

atom-json-color 0.6.0 
atom-json-editor 0.4.1 
busy-signal 2.0.0 
intentions 1.1.5 
linter 2.3.0 
linter-pylint 2.1.1 
linter-ui-default 1.7.1 
pretty-json 2.0.3 

Changes required due to TextBuffer.save becoming async in Atom 1.19

Hi! Thanks for maintaining the atom-json-editor package!

In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise that resolves when the save is complete. Because of this, a few other Atom APIs that use save have similarly become async:

  • Pane.close
  • TextBuffer.save
  • TextEditor.save
  • Pane.saveItem
  • Pane.saveItemAs
  • Pane.saveActiveItem
  • Pane.saveActiveItemAs
  • Pane.saveItems
  • Workspace.saveActivePaneItem
  • Workspace.saveActivePaneItemAs

Effects on this package

We think this package could be impacted by this upgrade because it calls the changed methods in the following places:

  • TextEditor.save

We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.

What to do about the change

It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:

Please let me know if you have any questions, I'd be happy to help!

Package not creating UI

i just install the add-on and restarted atom just in case and when i opened my json file nothing at all happend i dont know why its not showing up? Can you please help me

screen shot 2016-03-26 at 9 38 01 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.