Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsonforms/core

Package Overview
Dependencies
Maintainers
6
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonforms/core - npm Package Compare versions

Comparing version 3.1.0-alpha.2 to 3.1.0-alpha.3

5

lib/util/schema.d.ts

@@ -0,1 +1,6 @@

import { JsonSchema } from '../models';
export declare const getFirstPrimitiveProp: (schema: any) => string;
/**
* Tests whether the schema has an enum based on oneOf.
*/
export declare const isOneOfEnumSchema: (schema: JsonSchema) => boolean;

4

package.json
{
"name": "@jsonforms/core",
"version": "3.1.0-alpha.2",
"version": "3.1.0-alpha.3",
"description": "Core module of JSON Forms",

@@ -102,3 +102,3 @@ "repository": "https://github.com/eclipsesource/jsonforms",

},
"gitHead": "1e1ccad5f7ebfaf80412c8af3e422faebb12d0d5"
"gitHead": "f8ea38f9f9dd3d46cbfde269ec43e9eb1632e428"
}

@@ -48,3 +48,3 @@ /*

} from '../actions';
import { createAjv, Reducer } from '../util';
import { createAjv, isOneOfEnumSchema, Reducer } from '../util';
import type { JsonSchema, UISchemaElement } from '../models';

@@ -393,3 +393,7 @@

// Filter errors that match any keyword that we don't want to show in the UI
if (filteredErrorKeywords.indexOf(error.keyword) !== -1) {
// but keep the errors for oneOf enums
if (
filteredErrorKeywords.indexOf(error.keyword) !== -1 &&
!isOneOfEnumSchema(error.parentSchema)
) {
return false;

@@ -405,3 +409,3 @@ }

// The same holds true for errors on the array level (e.g. min item amount).
// In contrast, this comparison must not be done for errors whose parent schema defines an object
// In contrast, this comparison must not be done for errors whose parent schema defines an object or a oneOf enum,
// because the parent schema can never match the property schema (e.g. for 'required' checks).

@@ -412,2 +416,3 @@ const parentSchema: JsonSchema | undefined = error.parentSchema;

!isObjectSchema(parentSchema) &&
!isOneOfEnumSchema(parentSchema) &&
combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1

@@ -414,0 +419,0 @@ ) {

@@ -40,3 +40,8 @@ /*

} from '../models';
import { deriveTypes, hasType, resolveSchema } from '../util';
import {
deriveTypes,
hasType,
isOneOfEnumSchema,
resolveSchema,
} from '../util';

@@ -357,7 +362,3 @@ /**

uiTypeIs('Control'),
schemaMatches(
(schema) =>
schema.hasOwnProperty('oneOf') &&
(schema.oneOf as JsonSchema[]).every((s) => s.const !== undefined)
)
schemaMatches((schema) => isOneOfEnumSchema(schema))
);

@@ -522,3 +523,3 @@

}
if (val.oneOf && !isOneOfEnumControl(uischema, val, context)) {
if (val.oneOf && !isOneOfEnumSchema(val)) {
return true;

@@ -525,0 +526,0 @@ }

@@ -27,2 +27,3 @@ /*

import find from 'lodash/find';
import { JsonSchema } from '../models';

@@ -42,1 +43,9 @@ export const getFirstPrimitiveProp = (schema: any) => {

};
/**
* Tests whether the schema has an enum based on oneOf.
*/
export const isOneOfEnumSchema = (schema: JsonSchema) =>
schema?.hasOwnProperty('oneOf') &&
schema?.oneOf &&
(schema.oneOf as JsonSchema[]).every((s) => s.const !== undefined);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc