dschnelldavis / angular2-json-schema-form

Angular 2 JSON Schema Form builder
MIT License
285 stars 177 forks source link

JSON Schema Draft-04 version property blocks form generation #190

Open MathiasReichardt opened 6 years ago

MathiasReichardt commented 6 years ago

Issue type

I'm submitting a (check one): [x] Bug report [ ] Feature request [ ] Regression (something that used to work, but stopped working in a newer version) [ ] Support request [ ] Documentation issue or request

Prerequisites

Before posting, make sure you do the following (check all): [x] Confirm you are using the latest versions of all necessary packages (or if not, explain why not) [x] Search GitHub for a similar issue or PR [ ] If submitting a Support request, also search [Stack Overflow][stack-overflow] for similar issues Note: Please cross-post GitHub support requests to [Stack Overflow][stack-overflow], and include a link in your GitHub issue to your Stack Overflow question. We do currently respond to support requests on GitHub, but we eventually expect to stop, and will then refer all support questions exclusively to Stack Overflow.

Current behavior

When providing a JSON schema which contains the schema version "$schema": "http://json-schema.org/draft-04/schema#" no form is generated. Error message: Error: no schema with key or ref "http://json-schema.org/draft-06/schema#"

Expected behavior

IMPORTANT: How can we reproduce your problem?

  1. open the demo app
  2. paste example JSON schema:
    {
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "Name": {
            "type": "string"
        }
    }
    }

    ->error is thrown no form is generated. Delete line "$schema": "http://json-schema.org/draft-04/schema#", -> form is generated

Environment

OS name & version: Win 10 Browser name & version: Firefox 58, Chrome 63 Angular version: see Demoapp, found in project using Angular 5.2.2 Angular JSON Schema Form version(s): see Demoapp, found in project using 0.7.0-alpha.1 Other relevant software or packages:

Any other relevant information

As workaround: delete the schema property before passing it on to JSON Schema Form.

emilb604 commented 6 years ago

same here

emilb604 commented 6 years ago

any help would be appreciated, Failing with following error: ERROR Error: no schema with key or ref "http://json-schema.org/draft-06/schema#"

Using in angular 5, and trying to get data-only mode to run, not passing any schema

hamzahamidi commented 6 years ago

Is this library even compatible with JSON Schema draft 4?

hamzahamidi commented 6 years ago

Any news on this issue?

MathiasReichardt commented 6 years ago

With the upper workaround it works for my generated schemas.