Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export function getOptions(
const expression = (resolvedOneOf as JSONSchema7[]).find(({ $role }) => $role === 'expression');
const merged = merge({}, omit(schema, 'oneOf'), expression);

if (expression && (resolvedOneOf as JSONSchema7[]).some(({ properties, items }) => properties || items)) {
isNested =
isNested ||
!!(expression && (resolvedOneOf as JSONSchema7[]).some(({ properties, items }) => properties || items));

if (expression && isNested) {
options.push({
key: 'expression',
text: formatMessage('Write an expression'),
Expand All @@ -76,7 +80,6 @@ export function getOptions(
schema: merged,
},
});
isNested = true;
}

return { options, isNested };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ describe('resolveFieldWidget', () => {
it('returns OpenObjectField when additional properties are allowed', () => {
const schema = {
type: 'object' as const,
additionalProperties: true,
additionalProperties: {
type: 'string',
title: '',
description: '',
},
};

const { field: ReturnedField } = resolveFieldWidget({ schema });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function resolveFieldWidget(params: {
return { field: DefaultFields.ArrayField };
}
case 'object':
if (schema.additionalProperties) {
if (typeof schema.additionalProperties === 'object') {
return { field: DefaultFields.OpenObjectField };
} else if (!schema.properties) {
if (showIntellisense && isOneOf) {
Expand Down