diff --git a/src/utils/__tests__/openapi.test.ts b/src/utils/__tests__/openapi.test.ts index 9842f101..bcdfb193 100644 --- a/src/utils/__tests__/openapi.test.ts +++ b/src/utils/__tests__/openapi.test.ts @@ -362,7 +362,7 @@ describe('Utils', () => { it('should have a humanized constraint when multipleOf is set, and it is in format of /^0\\.0*1$/', () => { expect(humanizeConstraints(itemConstraintSchema(undefined, undefined, 0.01))).toContain( - 'decimals <= 2 digits', + 'decimal places <= 2', ); }); diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts index bcf17d3e..55efc600 100644 --- a/src/utils/openapi.ts +++ b/src/utils/openapi.ts @@ -374,9 +374,9 @@ function humanizeMultipleOfConstraint(multipleOf: number | undefined): string | } const strigifiedMultipleOf = multipleOf.toString(10); if (!/^0\.0*1$/.test(strigifiedMultipleOf)) { - return `multiple of ${multipleOf}`; + return `multiple of ${strigifiedMultipleOf}`; } - return `decimals <= ${strigifiedMultipleOf.split('.')[1].length} digits`; + return `decimal places <= ${strigifiedMultipleOf.split('.')[1].length} digits`; } function humanizeRangeConstraint(