Skip to content

Fix BoxLang required-field detection in OpenAPIConstraintsGenerator.#53

Open
DiscountDarcy wants to merge 1 commit into
coldbox-modules:developmentfrom
inLeague:fix/boxlang-swagger-sdk-ref-cycles
Open

Fix BoxLang required-field detection in OpenAPIConstraintsGenerator.#53
DiscountDarcy wants to merge 1 commit into
coldbox-modules:developmentfrom
inLeague:fix/boxlang-swagger-sdk-ref-cycles

Conversation

@DiscountDarcy

Copy link
Copy Markdown

Description

On BoxLang, OpenAPIConstraintsGenerator treats optional request-body fields as required because it does arrayContainsNoCase(...) > 0, and BoxLang evaluates false > 0 as true.

Solution: Use the arrayContainsNoCase result as a boolean (truthiness only). Pair with the swagger-sdk $ref parse fix below for full BoxLang OpenAPI generation.

coldbox-modules/swagger-sdk#27

Please note that all PRs must have tests attached to them

IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.

Issues

Probably this one (might be a newer incarnation of the same issue)

Type of change

Please delete options that are not relevant.

  • Bug Fix

Checklist

  • My code follows the style guidelines of this project cfformat
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

arrayContainsNoCase returns a boolean on BoxLang, and comparing false > 0
incorrectly marks optional schema fields as required.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant