Skip to content

Commit f1af409

Browse files
authored
fix: correct display of minimal value in case it is 0 (#172)
1 parent 2c2fb61 commit f1af409

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

library/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"dependencies": {
5353
"@asyncapi/avro-schema-parser": "^0.2.0",
5454
"@asyncapi/openapi-schema-parser": "^2.0.0",
55-
"@asyncapi/parser": "^1.0.0-rc.5",
55+
"@asyncapi/parser": "^1.0.1",
5656
"constate": "^1.2.0",
5757
"dompurify": "^2.1.1",
5858
"markdown-it": "^11.0.1",

library/src/containers/Schemas/SchemaProperties.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export const SchemaPropertiesComponent: React.FunctionComponent<Props> = ({
214214
Unique
215215
</span>
216216
)}
217-
{element.schema.content.minItems && (
217+
{typeof element.schema.content.minItems === 'number' && (
218218
<span
219219
className="bg-purple-dark font-bold no-underline text-white rounded lowercase ml-2"
220220
style={{ height: '20px', fontSize: '11px', padding: '3px' }}
@@ -223,7 +223,7 @@ export const SchemaPropertiesComponent: React.FunctionComponent<Props> = ({
223223
&gt;= {element.schema.content.minItems} items
224224
</span>
225225
)}
226-
{element.schema.content.maxItems && (
226+
{typeof element.schema.content.maxItems === 'number' && (
227227
<span
228228
className="bg-purple-dark font-bold no-underline text-white rounded lowercase ml-2"
229229
style={{ height: '20px', fontSize: '11px', padding: '3px' }}
@@ -232,7 +232,7 @@ export const SchemaPropertiesComponent: React.FunctionComponent<Props> = ({
232232
&lt;= {element.schema.content.maxItems} items
233233
</span>
234234
)}
235-
{element.schema.content.minLength && (
235+
{typeof element.schema.content.minLength === 'number' && (
236236
<span
237237
className="bg-purple-dark font-bold no-underline text-white rounded lowercase ml-2"
238238
style={{ height: '20px', fontSize: '11px', padding: '3px' }}
@@ -241,7 +241,7 @@ export const SchemaPropertiesComponent: React.FunctionComponent<Props> = ({
241241
length &gt;= {element.schema.content.minLength}
242242
</span>
243243
)}
244-
{element.schema.content.maxLength && (
244+
{typeof element.schema.content.maxLength === 'number' && (
245245
<span
246246
className="bg-purple-dark font-bold no-underline text-white rounded lowercase ml-2"
247247
style={{ height: '20px', fontSize: '11px', padding: '3px' }}
@@ -250,7 +250,7 @@ export const SchemaPropertiesComponent: React.FunctionComponent<Props> = ({
250250
length &lt;= {element.schema.content.maxLength}
251251
</span>
252252
)}
253-
{element.schema.content.minimum && (
253+
{typeof element.schema.content.minimum === 'number' && (
254254
<span
255255
className="bg-purple-dark font-bold no-underline text-white rounded lowercase ml-2"
256256
style={{ height: '20px', fontSize: '11px', padding: '3px' }}
@@ -259,7 +259,7 @@ export const SchemaPropertiesComponent: React.FunctionComponent<Props> = ({
259259
&gt;= {element.schema.content.minimum}
260260
</span>
261261
)}
262-
{element.schema.content.maximum && (
262+
{typeof element.schema.content.maximum === 'number' && (
263263
<span
264264
className="bg-purple-dark font-bold no-underline text-white rounded lowercase ml-2"
265265
style={{ height: '20px', fontSize: '11px', padding: '3px' }}

0 commit comments

Comments
 (0)