Skip to content

feat: support boolean and timestamp for edgeOptimizeConfig.enabled#1441

Merged
jindaliiita merged 2 commits intomainfrom
enabled-check
Mar 17, 2026
Merged

feat: support boolean and timestamp for edgeOptimizeConfig.enabled#1441
jindaliiita merged 2 commits intomainfrom
enabled-check

Conversation

@jindaliiita
Copy link
Contributor

Summary

Update edgeOptimizeConfig.enabled field to accept both boolean and number (timestamp) types.

Changes

  • Modified Joi schema to use Joi.alternatives() accepting both Joi.boolean() and Joi.number()
  • Updated OpenAPI schema to reflect dual-type support

Use Cases

  • Boolean: enabled: true/false - Flag to enable/disable edge optimization
  • Timestamp: enabled: 1772531669121 - Store timestamp (milliseconds since epoch) of when edge optimization was enabled for the site

Example

// Enable/disable flag
{ edgeOptimizeConfig: { enabled: true } }
{ edgeOptimizeConfig: { enabled: false } }

// Store enablement timestamp
{ edgeOptimizeConfig: { enabled: 1772531669121 } }

Testing

  • All existing edgeOptimizeConfig tests pass (11/11)
  • Schema correctly validates both boolean and number types

🤖 Generated with Claude Code

@github-actions
Copy link

This PR will trigger a patch release when merged.

@jindaliiita jindaliiita merged commit 2fb173d into main Mar 17, 2026
7 checks passed
@jindaliiita jindaliiita deleted the enabled-check branch March 17, 2026 08:25
jindaliiita added a commit to adobe/spacecat-api-service that referenced this pull request Mar 17, 2026
…mp (#1961)

## Summary
Update OpenAPI schema for `EdgeOptimizeConfig` to reflect support for
both boolean and timestamp (number) types for the `enabled` field.

## Changes
- Updated `docs/openapi/schemas.yaml` to use `oneOf` for dual-type
support
- Updated schema description to clarify use cases

## Use Cases
- **Boolean**: `enabled: true/false` - Flag to enable/disable edge
optimization
- **Timestamp**: `enabled: 1772531669121` - Store timestamp
(milliseconds since epoch) of when edge optimization was enabled for the
site

## Schema Example
```yaml
enabled:
  description: Whether edge optimize is enabled. Can be boolean flag or timestamp.
  oneOf:
    - type: boolean
      example: true
    - type: number
      example: 1772531669121
```

## Related
- Depends on: adobe/spacecat-shared#1441 (schema validation in
data-access layer)

🤖 Generated with Claude Code

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
solaris007 pushed a commit that referenced this pull request Mar 17, 2026
## [@adobe/spacecat-shared-data-access-v3.22.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.21.0...@adobe/spacecat-shared-data-access-v3.22.0) (2026-03-17)

### Features

* support boolean and timestamp for edgeOptimizeConfig.enabled ([#1441](#1441)) ([2fb173d](2fb173d))
@solaris007
Copy link
Member

🎉 This PR is included in version @adobe/spacecat-shared-data-access-v3.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants