microsoft / AdaptiveCards

A new way for developers to exchange card content in a common and consistent way.
https://adaptivecards.io
MIT License
1.75k stars 550 forks source link

[Feature Request] Make Shared Model SDKs more lenient in card parsing #6015

Open jonmill opened 3 years ago

jonmill commented 3 years ago

What is the problem you are attempting to solve with this feature?

There is a implementation difference between Adaptive Cards SDKs where shared model SDKs are more strict, in terms of Card parsing, than the JS version. This leads to many issues in Teams where Cards will render correctly in desktop but fail in the mobile apps, which causes a large support cost (actualized and developer-time) for Teams.

A description of your proposed solution to the problem

The AC SDKs need to normalize on a single standard of strict-ness of Card parsing. Due to the large existing customer base and existing scenarios, the only viable path is to match the Javascript strict-ness in the mobile SDKs; this is the only path forward because the other approach would break existing users without any change to their Cards, which would not be a good user experience.

golddove commented 3 years ago

Invalid values (e.g. number type given when string type expected) for a property should be ignored when the property is optional (see request #6046)

jwoo-msft commented 3 years ago

In cases of ID collisions, the parser won't throw exceptions. The parser will generate warnings, and the host app's renderer will decide to render the card with such warnings or not. All renderers will have a strict option, and the option will cause rendering to fail when the option is turned on in the future. (#4226, #6236))