Skip to content

Commit

Permalink
fix: Fix complex descriptions (with constraints)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorox112 authored and v8tenko committed Oct 21, 2024
1 parent f4d0388 commit b4526d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/includer/traverse/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ const fields: Fields = [
key: 'pattern',
label: 'Pattern',
},
{
(value) => ({
key: 'uniqueItems',
label: 'Unique items',
},
computed: String(value.uniqueItems),
}),
(value) => {
return {
key: 'minimum',
Expand Down Expand Up @@ -75,7 +76,7 @@ function prepareComplexDescription(baseDescription: string, value: OpenJSONSchem
return fields.reduce((acc, curr) => {
const field = typeof curr === 'function' ? curr(value) : curr;

if (typeof field === 'undefined' || !value[field.key]) {
if (typeof field === 'undefined' || typeof value[field.key] === 'undefined') {
return acc;
}

Expand Down

0 comments on commit b4526d0

Please sign in to comment.