microsoft / microsoft/AdaptiveCards
[JS] Serialization `toJSON` methods do not type check
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Platform
- JavaScript
Issue
The toJSON methods within serialization.ts are not properly checking the type of value. The parent class, PropertyDefinition, allows any as the value type, so typescript will allow any type to be passed to the overloaded methods on the child classes.
Proposed solution:
Allow all methods to accept any for value and do additional checking within the methods.
See this PR (only some portions are relevant): https://github.com/microsoft/AdaptiveCards/pull/7762
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading serialization.ts and reproducing the linked TypeScript example to identify which toJSON overloads accept incompatible values. Done means the affected methods perform the required value checks while preserving valid serialization behavior; verify the relevant TypeScript checks or existing serialization tests if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100