Skip to content

Conversation

cnaples79
Copy link

Summary

This PR updates the Spacing type and the JSON schema to support both lowercase and capitalized values for the spacing property in Adaptive Cards. This addresses the inconsistency between the Adaptive Cards Designer, which uses capitalized values, and the linter in this repository, which prefers lowercase values.

Changes

  • packages/cards/src/core.ts: Added lowercase and camelCase variants to the Spacing type definition.
  • packages/cards/schema.json: Updated the regex for 13.columnSpacing to include ExtraSmall and its variants.

Rationale

This change avoids confusion for developers and improves the developer experience by allowing either casing to be used for the spacing property. Both capitalized and lowercase values are rendered correctly in Teams, so this change makes the SDK more flexible.

Fixes #132

@cnaples79 cnaples79 requested a review from dclaux as a code owner October 11, 2025 07:00
@corinagum
Copy link
Collaborator

@cnaples79 thanks for the contribution! Unfortunately this method won't work, since schema.json and core.ts are generated files and would be overwritten next time the schema is updated. I think it would be best to come up with a proposal to handle these programmatically.

IIRC schema.json is not used directly, so core.ts would need to be updated. @aacebo could you verify?

@cnaples79
Copy link
Author

@corinagum I see, got it thanks for the feedback. I'll work on updating the implementation.

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.

[cards] support lowercase and Capitalized JSON values

2 participants