AdaptiveCards/schemas
PankajBhojwani 38717289d2
Implement closed captions in JS and UWP (#7178)
* captions init

* nodejs works, uwp builds

* uwp works

* update to media player element

* don't actually change the sample

* minor changes

* use namespace

* update this

* base class in shared, uwp next

* base class for uwp

* Base class for ts

* add language property to ts, use that as label

* lang property

* validate mimetype

* Remove audio height

* Rename to label

* v1.6

* consistent

* allow custom resource resolver

* lambda var

* inner struct property editor

* fix capturing

* uwp only support vtt too

* uwp supports srt again

* use ...

* arrange vertically

* back to element

* address some comments

* use get()

* use dictionary

* parser, override

Co-authored-by: Vsevolod <sevkorobot@gmail.com>
2022-04-19 20:13:08 +00:00
..
1.1.0 Schema and site updates for 1.2 (#3044) 2019-06-12 08:49:46 -07:00
1.2.0 Fix typo (#3108) 2019-07-01 11:28:26 -07:00
1.2.1 Fix ActionSet description (#3423) 2020-07-20 10:46:23 -07:00
1.3.0 Feature/associated inputs (#5155) 2020-12-10 12:40:43 -08:00
1.4.0 Updating Bot Framework links (#6686) 2021-11-15 19:06:27 +00:00
1.5.0 Updating Bot Framework links (#6686) 2021-11-15 19:06:27 +00:00
1.6.0 Implement closed captions in JS and UWP (#7178) 2022-04-19 20:13:08 +00:00
src Implement closed captions in JS and UWP (#7178) 2022-04-19 20:13:08 +00:00
.gitignore Schema and site updates for 1.2 (#3044) 2019-06-12 08:49:46 -07:00
README.md [Schema] Add password masking to the 1.5 schema (#6376) 2021-10-01 21:36:19 -07:00
host-config.json [Schema] Add password masking to the 1.5 schema (#6376) 2021-10-01 21:36:19 -07:00
package-lock.json Schema 1.4 (#5317) 2021-03-11 08:26:05 -08:00

README.md

Schema files

Are you looking to make schema changes and don't know where to start? Make sure to check out our contribution guidelines to get started.

AdaptiveCard schema

Referenceable versions

Here's a list of the schema URLs you can reference:

Generating the schema

The Adaptive Card schema is generated from "typed schema" files located in the src folder. These typed schema files are much easier to author. The schema is then compiled into the standard JSON schema file using the nodejs ac-typed-schema project in Adaptive Cards. The fact that it's compiled means we can support case-insensitive enums (via lengthy regex expressions) and it also means it's way easier to update the schema and produce a reliable and correct schema without having to worry about #/definitions and everything!

Our schema explorer on the website is also generated from the typed schema files in the src folder.

To generate the schema, see ac-typed-schema. Once built (see the nodejs README), run npm run generate-adaptive-schema. This will output the generated schema as schemas/adaptive-card.json (which should not be checked in). From here, the file should be copied into the version-appropriate subfolder (e.g. cd schemas && cp adaptive-card.json 1.4.0/adaptive-card.json).

Generating the schema spec markdown

Once the schema itself is generating correctly, the markdown specs need to be generated as well, at least for testing (the markdown files are automatically generated by a PR builds). The tool you need is spec-generator. Once built, issue the command npm run run (yes, really), which will generate the various markdown files you can find in the specs folder. More details can be found in the specs README.

Non-extensible schema

The schema is strict. It doesn't allow unknown types or unknown properties. There's a good reason for that - if we DID allow unknown types/properties, then you wouldn't even know if you're accidently using an unknown property or type... and at that point, why even validate at all!

If you want to run automated tests using the schema in your CI but have to use host-specific properties, you can always add exemptions in your tests when your test fails because of unknown "Action.InvokeAddIn". Then you still get the value of knowing when you're using incorrect properties, and you have to specifically add the known extension properties to a test allowlist of your own.

Versioned schema

We keep a version history of the schema, and we only support referencing a specific version of the schema. That's because you really don't want the schema randomly changing on you! Updating the schema must be a conscious decision.