Skip to content

Support boolean field in configuration#392

Open
asalloum5 wants to merge 1 commit intomainfrom
CEXT-6078
Open

Support boolean field in configuration#392
asalloum5 wants to merge 1 commit intomainfrom
CEXT-6078

Conversation

@asalloum5
Copy link
Copy Markdown
Collaborator

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have read the DEVELOPMENT document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 146598b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added without-changeset The PR does not contain a Changeset file pkg: aio-commerce-lib-config Includes changes in `packages/aio-commerce-lib-config` pkg: aio-commerce-lib-app Includes changes in `packages/aio-commerce-lib-app` labels Apr 15, 2026
Copy link
Copy Markdown
Member

@obarcelonap obarcelonap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check sanitizeRequestEntries because I believe it silently drops boolean values because of the following validation,

// TODO: This should be done via schema validation.
const hasValidValue =
["string"].includes(typeof entry.value) ||
(Array.isArray(entry.value) &&
entry.value.every((item) => typeof item === "string"));

Probably is the moment to try to attend that TODO comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing changeset

Copy link
Copy Markdown
Collaborator

@iivvaannxx iivvaannxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might need to do some further changes around this code

EDIT: Didn't see @obarcelonap comment above, but we are referring to the same

const BooleanSchema = v.object({
...BaseOptionSchema.entries,
type: v.literal("boolean", "Expected the type to be 'boolean'"),
default: v.optional(v.boolean("Expected a boolean for the default value")),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the SingleValueList schema type, which requires a mandatory default as we can't infer it at configuration time, all other field types have a default value for the default value (see text fields example). What should we have as default for this? Maybe false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: aio-commerce-lib-app Includes changes in `packages/aio-commerce-lib-app` pkg: aio-commerce-lib-config Includes changes in `packages/aio-commerce-lib-config` without-changeset The PR does not contain a Changeset file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants