Skip to content

Fix YAML date coercion - #51

Merged
GrahamCampbell merged 2 commits into
mainfrom
fix-yaml-date-coercion
Sep 6, 2026
Merged

Fix YAML date coercion#51
GrahamCampbell merged 2 commits into
mainfrom
fix-yaml-date-coercion

Conversation

@GrahamCampbell

Copy link
Copy Markdown
Contributor

The configuration reader parses serverless-compose.yml with js-yaml's default schema, which resolves unquoted date-shaped scalars to Date objects, so after JSON normalisation a params value such as 2012-10-17 reaches the service as --param key=2012-10-17T00:00:00.000Z and a date-shaped mapping key becomes a timezone-dependent string. The framework component parses the unquoted Key: Value lines of osls info --verbose the same way, so a date-shaped stack output is rewritten before it is stored in state and substituted into dependent services. This adds a shared schema that drops implicit timestamp resolution while keeping an explicit !!timestamp tag, mirroring oss-serverless/osls#441, and applies it at the configuration reader and the framework component's YAML loads, with tests for each. Fixes #50.

@GrahamCampbell
GrahamCampbell merged commit 2c8c84e into main Sep 6, 2026
4 checks passed
@GrahamCampbell
GrahamCampbell deleted the fix-yaml-date-coercion branch September 6, 2026 16:35
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.

Date-shaped YAML values are coerced in configuration and stack outputs

1 participant