Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openapi-to-typespec] Missing @typespec/versioning import #4931

Open
catalinaperalta opened this issue Mar 25, 2024 · 1 comment
Open

[openapi-to-typespec] Missing @typespec/versioning import #4931

catalinaperalta opened this issue Mar 25, 2024 · 1 comment
Labels
openapi-to-tsp Tracks OpenAPI to Cadl converter issues

Comments

@catalinaperalta
Copy link
Member

catalinaperalta commented Mar 25, 2024

When converting a swagger to typespec, the @versioned decorator is correctly added, but the spec is missing the import and using statements. We need to add the following in the main.tsp ouput:

import "@typespec/versioning";

using TypeSpec.Versioning;

Showed up when converting the following spec: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/appconfiguration/data-plane/readme.md

cc @joheredi @tadelesh

@catalinaperalta catalinaperalta added the openapi-to-tsp Tracks OpenAPI to Cadl converter issues label Mar 25, 2024
@catalinaperalta
Copy link
Member Author

Another issue with the versioning support, the enum needs to specify the Azure Core version is depends on.

Current output:

@doc("The available API versions.")
enum Versions {
  v2023_11_01: "2023-11-01",
}

Expected output:

@doc("The available API versions.")
enum Versions {
  @useDependency(Azure.Core.Versions.v1_0_Preview_2)
  v2023_11_01: "2023-11-01",
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openapi-to-tsp Tracks OpenAPI to Cadl converter issues
Projects
None yet
Development

No branches or pull requests

1 participant