Skip to content

Update API plugin manifest schema from v2.3 to v2.4#7166

Merged
gavinbarron merged 2 commits intomainfrom
copilot/update-x-ai-adaptive-card-schema
Nov 26, 2025
Merged

Update API plugin manifest schema from v2.3 to v2.4#7166
gavinbarron merged 2 commits intomainfrom
copilot/update-x-ai-adaptive-card-schema

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 26, 2025

Updates the API plugin manifest schema version from v2.3 to v2.4 to align with the latest Microsoft 365 Copilot API plugin manifest specification.

Changes

  • Source code: Updated PluginsGenerationService.cs to generate v2.4 manifests with updated schema URL
  • Examples: Updated schema references in githubsearch-apiplugin.json and suno-with-extensions-apiplugin.json
  • Tests: Updated schema references in PluginModelWithSecurity.json and PluginDiscriminatorSample.json

All schema URLs changed from:

  • https://developer.microsoft.com/json-schemas/copilot/plugin/v2.3/schema.jsonv2.4
  • https://aka.ms/json-schemas/copilot-extensions/v2.3/plugin.schema.jsonv2.4

Generated manifests will now reference the v2.4 schema.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/microsoftgraph/msgraph-metadata/contents/apis.json
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.deps.json /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/testhost.dll --port 44833 --endpoint 127.0.0.1:044833 --role client --parentprocessid 6712 --telemetryoptedin false (http block)
  • https://api.github.com/repos/microsoftgraph/msgraph-metadata/contents/apis.yaml
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.deps.json /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/testhost.dll --port 44833 --endpoint 127.0.0.1:044833 --role client --parentprocessid 6712 --telemetryoptedin false (http block)
  • https://api.github.com/search/repositories
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.deps.json /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/testhost.dll --port 44833 --endpoint 127.0.0.1:044833 --role client --parentprocessid 6712 --telemetryoptedin false (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Update the x-ai-adaptive-card extension schema to the latest supported one (2.4)</issue_title>
<issue_description>### Is your feature request related to a problem? Please describe the problem.

Currently, Kiota generates v2.3 of the plugin manifest and we are now at 2.4.

Client library/SDK language

None

Describe the solution you'd like

Map to the latest schema from the API Plugin manifest: https://learn.microsoft.com/en-us/microsoft-365-copilot/extensibility/api-plugin-manifest-2.4

Additional context

No response</issue_description>

<agent_instructions>Just update the version of the manifest to 2.4 and do a PR. NOTHING ELSE.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: sebastienlevert <7620955+sebastienlevert@users.noreply.github.com>
Copilot AI changed the title [WIP] Update the x-ai-adaptive-card extension schema to 2.4 Update API plugin manifest schema from v2.3 to v2.4 Nov 26, 2025
@sebastienlevert sebastienlevert marked this pull request as ready for review November 26, 2025 18:15
@sebastienlevert sebastienlevert requested a review from a team as a code owner November 26, 2025 18:15
@gavinbarron gavinbarron merged commit dbc68ac into main Nov 26, 2025
288 checks passed
@gavinbarron gavinbarron deleted the copilot/update-x-ai-adaptive-card-schema branch November 26, 2025 18:32
Alive-Fish added a commit to OfficeDev/microsoft-365-agents-toolkit that referenced this pull request Apr 23, 2026
… through Kiota plugin generation (#15731) (#15772)

* fix: propagate x-ai-adaptive-card and x-openai-isConsequential into Kiota plugin manifest (#15731)

Bumps `@microsoft/kiota` to 1.31.1 (which emits plugin manifest
schema v2.4 via microsoft/kiota#7166) and adds a workaround that
patches the generated `*-apiplugin.json` so the following OpenAPI
extensions are honored:

- `x-ai-adaptive-card` -> `function.capabilities.response_semantics`
  (with `data_path` and the inlined Adaptive Card as `static_template`)
- `x-ai-capabilities.confirmation` -> `function.capabilities.confirmation`
- `x-openai-isConsequential` -> `confirmation.isNonConsequential`
  (negated, since "non-consequential" is the inverse)

As of Kiota 1.31.1 the v2.4 schema bump only changed the manifest
header; the generator still drops these extensions. The workaround
in `patchOpenApiExtensionsIntoPluginManifest` reads the source spec
emitted by `tsp compile`, walks every operation, and merges the
extension data into the plugin manifest produced by Kiota. It only
fills in capability blocks Kiota left empty - existing values are
preserved.

The new helper is invoked from `TypeSpecCompileDriver.execute`
immediately after each `kiotageneratePlugin` call (both the
single-spec and multi-spec branches).

Tests:
- 8 new unit tests in `tests/common/daSpecParser.test.ts` covering
  the happy paths, both `isConsequential` polarities, no-overwrite
  behavior, no-op behavior, missing inputs, invalid YAML, and
  unreadable Adaptive Card files.
- Full `npm run test:unit` line coverage stays above the 72.7%
  nyc threshold.

Fixes #15731

* fix: inline Adaptive Card `static_template` placeholder emitted by Kiota (#15731)

Follow-up to the original #15731 fix. End-to-end testing against a real
TypeSpec project showed that Kiota 1.31.1 actually does emit a
`response_semantics` block, but with a placeholder of the form

    "static_template": { "file": "adaptiveCards/<name>.json" }

instead of inlining the Adaptive Card JSON itself. Microsoft 365 Copilot
expects `static_template` to be the card object, so the previous
"only fill if missing" guard left a non-functional manifest.

Changes:

- `patchOpenApiExtensionsIntoPluginManifest` now detects this placeholder
  shape (object with only a `file` property and none of `type`,
  `$schema`, `body`) and replaces it with the inlined card JSON.
- Real cards already inlined by hand are left untouched.
- The card-resolution helper now searches several candidate base
  directories (plugin manifest dir, its parent, its grandparent, spec
  dir, and the spec dir's parent), since the typical layout puts the
  card file in `<root>/adaptiveCards/` while the plugin manifest lives
  in `<root>/.generated/`.
- 3 new unit tests cover: inlining the Kiota placeholder, preserving a
  real existing card, and resolving cards from the parent of the plugin
  manifest dir. All 11 tests under "patchOpenApiExtensionsIntoPluginManifest
  (issue #15731)" pass.

Refs #15731

* test(fx-core): add coverage for patcher resolveCardJson catch and data_path backfill (#15731)

* test(fx-core): cover parsed-spec-no-paths guard in patcher (#15731)
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.

Update the x-ai-adaptive-card extension schema to the latest supported one (2.4)

3 participants