1

I am using Angular6-json-schema-form library and included

import { Bootstrap4FrameworkModule } from 'angular6-json-schema-form' in the app.module.ts file. Also i created a JSON schema object in the component file and used the below in the app.component.html file

<json-schema-form loadExternalAssets="true" [schema]="yourschema" framework="bootstrap-4"></json-schema-form>

But when i do npm start and do a localhost i am getting an error in the console

ERROR Error: schema with key or id "http://json-schema.org/draft-06/schema" already exists

Can anyone please help me in resolving the issue.

  • Try to perform below commands in command prompts : rm -rf /node_modules and after that installing the packages again by npm install – Suresh Jul 16 '20 at 19:48

1 Answers1

2

It seems like there are two JSON schemas within your project both having the id of "http://json-schema.org/draft-06/schema". There could be two reasons for this:

  1. There is actually another JSON schema file you are using with the same exact id.
  2. There is only one schema with this id but the framework is having a hard time reading your $id off the schema. We also had some difficulties reading $id with this framework back in our team. try removing the $id and its value and re-run your app.