Giter VIP home page Giter VIP logo

json-schema-form's People

Contributors

aeberhart avatar dependabot[bot] avatar eberhaal avatar sibiraj-s avatar uw4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

json-schema-form's Issues

features missing to reach draft-06 conformity

Will not support

  • patternProperties, like additionalProperties: fairly complicated to implement since the schema for the subcomponent changes once the key is edited
  • const: provides no value for an editor
  • Combining schemas (oneOf, anyOf, not, allOf): impossible to do for a form generator

allow hiding null properties

There can be cases, where several properties are available but most of them are null / undefined. An example is editing JSON schema itself. title, description, and many other properties are available and clutter the form. Should be possible to define a layout where these can be expanded via a ... button

autocomplete caching

select "simpleGet" example and enter text field.
select "jsonPath" example and enter text field.
The dropdown options are the same but there should be only 4 options since the complex json same is shorter.

Support additionalProperties

In order to edit json with arbitrary keys we need to support additionalProperties.

Internally, can be treated like an array of key value objects

required should be compliant to the latest json schema spec

{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "version": {
      "type": "number"
    }
  }
}


rather than

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string", "required"=true
    },
    "version": {
      "type": "number"
    }
  }
}

include styling parameters in schema

similar to layout. candidates are:

  • width
  • height / font size

.mat-form-field {
height: 1.5em !important;
font-size: 0.8em !important;
}

  • textarea rows / cols (can get rid of largetextarea widget)

readonly components

define a custom json schema attribute that causes the form to only display and not edit a value

allow to specify an object template

allow for computed keys on objects:

{
computed: { y: "prefix-${x}" } ]
properties: { x : { type: string } }
}

entering 1 as the value for x would set y to prefix-1

propagate validation errors

there should be a boolean output variable that indicates whether the form is valid or not.
This would allow the caller to attach the disabled prop to the form directly:

invalid: boolean

<lib-json-schema-form (invalid)="invalid" ....
<button (click)="..." [disabled]="invalid">

array edit with tab

Select the "array" example and press + a couple of times.
enter a value and press TAB.
The same value shows up in the next input field but not in the JSON value.

support resolving external $ref

So far, $ref only supports json pointer references in the schema document (root schema passed to the component).
Consider these examples:

https://raw.githubusercontent.com/riskine/ontology/master/schemas/core/damage.json
https://raw.githubusercontent.com/riskine/ontology/master/schemas/core/definitions.json

Definitions.json contains basic defs which are referenced in damage.json using
"$ref": "definitions.json#/money"

It should be possible to provide the component with a resolver implementation that is able to load schemata based on their $id. In this specific example, a schema "https://ontology.riskine.com/X" can be read from "https://raw.githubusercontent.com/riskine/ontology/master/schemas/core/X". Note that the spec explicitly states that $id does not have to be "downloadable".

One resolver could be a HTTP download resolver. Another one could be a simple map: {id, schema}.

It should be possible to use the form simply by providing a $ref to an external schema:

<lib-json-schema-form [(value)]="value" [schema]="{'$ref': 'http://....'}" resolver="url">

a11y bug array

In the editor, with default layout, for type array there is an a11y problem.

When hovering one input field by mouse, the delete button appears, but when using only the keyboard for navigation, it is not possible to delete an entry - the delete button is not visible and can't be reached.

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.