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 tsp] Fix accept header logic #4941

Open
catalinaperalta opened this issue Apr 8, 2024 · 2 comments
Open

[openapi to tsp] Fix accept header logic #4941

catalinaperalta opened this issue Apr 8, 2024 · 2 comments
Labels
openapi-to-tsp Tracks OpenAPI to Cadl converter issues

Comments

@catalinaperalta
Copy link
Member

Given the following swagger definition:

        "produces": [
          "application/vnd.microsoft.appconfig.kv+json",
          "application/problem+json"
        ],

The converter outputs the following typespec code where all of the supported content types are bundled into 1 string:

accept: "application/vnd.microsoft.appconfig.kv+json, application/problem+json";

The correct code should represent each content type individually:

accept: "application/vnd.microsoft.appconfig.kv+json" | "application/problem+json";

cc @joheredi

@catalinaperalta catalinaperalta added the openapi-to-tsp Tracks OpenAPI to Cadl converter issues label Apr 8, 2024
@pshao25
Copy link
Member

pshao25 commented Aug 21, 2024

@catalinaperalta could you show me the full swagger so that I could know which template we should use for this operation. I assume it might be ResourceRead, which seems lack of ability to override the content type. So I'm going to ask TSP team. Before that I need to know the full story.

@catalinaperalta
Copy link
Member Author

catalinaperalta commented Aug 24, 2024

This spec was converted to typespec a few months ago so you'll have to look at an older version of the swagger, linking it here: https://github.com/Azure/azure-rest-api-specs/blob/c1af3ab8e803da2f40fc90217a6d023bc13b677f/specification/appconfiguration/data-plane/Microsoft.AppConfiguration/stable/2023-11-01/appconfiguration.json

IIRC you'll be able to see that there are several operations with multiple produces statements it wasnt just a 1 time occurrence in the converted code.

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

2 participants