From b57936b995f327fe9a22a449ffb9294309028041 Mon Sep 17 00:00:00 2001 From: Samuel Knowlton Date: Sat, 25 Jul 2026 13:13:49 -0500 Subject: [PATCH] Fix BoxLang required-field detection in OpenAPIConstraintsGenerator. arrayContainsNoCase returns a boolean on BoxLang, and comparing false > 0 incorrectly marks optional schema fields as required. Co-authored-by: Cursor --- changelog.md | 5 +++++ models/OpenAPIConstraintsGenerator.cfc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index a6a2094..60f6d00 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- BoxLang `$ref` parse hangs / bad absolute paths: depend on `swagger-sdk` with cycle-safe walks, absolute path resolution, and no `isStruct(cfc)` on nested parsers (see coldbox-modules/swagger-sdk). +- BoxLang: treat `arrayContainsNoCase` as boolean in `OpenAPIConstraintsGenerator` (do not compare with `> 0`; BoxLang evaluates `false > 0` as true). + ## [3.1.3] - 2025-10-29 ## [3.1.2] - 2024-09-24 diff --git a/models/OpenAPIConstraintsGenerator.cfc b/models/OpenAPIConstraintsGenerator.cfc index d54d1dd..c3ecf23 100644 --- a/models/OpenAPIConstraintsGenerator.cfc +++ b/models/OpenAPIConstraintsGenerator.cfc @@ -58,7 +58,8 @@ component name="OpenAPIConstraintsGenerator" { return arguments.properties.map( ( fieldName, schema ) => { return generateConstraint( schema = schema, - isRequired = arrayContainsNoCase( requiredFields, fieldName ) > 0 + // BoxLang returns boolean; `false > 0` is true there — use truthiness only + isRequired = arrayContainsNoCase( requiredFields, fieldName ) ); } ); }