OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
453 stars 185 forks source link

OpenAPI version 3.1.0 is not supported. when creating Copilot Declarative Agent #12476

Open alexheat opened 12 hours ago

alexheat commented 12 hours ago

Describe the bug When attempting to import an OpenAPI specification file, an error message is displayed stating: "OpenAPI version 3.1.0 is not supported. Use version 3.0.x."

To Reproduce Steps to reproduce the behavior:

  1. Create new App in the Teams Toolkit
  2. Choose Declarative Agent and then Add Plugin and Start with an OpenAPI Description Document
  3. Browse for a file with OpenAI schema version 3.1.0 (see attached file as a sample)
  4. Upon import I get an error "OpenAPI version 3.1.0 is not supported. Use version 3.0.x." image

Expected behavior Open AI GPTs only support Open API 3.1.0 so in order to import an existing OpenAPI description the Teams Toolkit should support the 3.1.0 schema

Screenshots If applicable, add screenshots to help explain your problem.

From Open AI GPTs: They don't support OpenAPI 3.0

image

VS Code Extension Information (please complete the following information):

CLI Information (please complete the following information):

Additional context Sample file for testing attached here: sample.json

{
  "openapi": "3.1.0",
  "info": {
    "title": "Get weather data",
    "description": "Retrieves current weather data for a location.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://weather.example.com"
    }
  ],
  "paths": {
    "/location": {
      "get": {
        "description": "Get temperature for a specific location",
        "operationId": "GetCurrentWeather",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "description": "The city and state to retrieve the weather for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {}
  }
}
microsoft-github-policy-service[bot] commented 12 hours ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

SLdragon commented 2 hours ago

Hi, @alexheat , this is a known limitation for Copilot Declarative Agent, because the backend using OpenAPI.NET to parse OpenAPI spec file, which currently only support version < 3.1.0. We will support it once it is ready

Related issue can be found here: https://github.com/microsoft/OpenAPI.NET/issues/795

For your scenario, if you're not using OpenAPI 3.1.0 features, you can change it to 3.0 for the Copilot Declarative Agent and keep it at 3.1.0 for OpenAI GPTs.