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

Error: no response content type found for deserialization #1485

Open
tonven opened this issue Nov 13, 2024 · 7 comments
Open

Error: no response content type found for deserialization #1485

tonven opened this issue Nov 13, 2024 · 7 comments
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@tonven
Copy link

tonven commented Nov 13, 2024

Hi. After calling POST endpoint which returns 204 No Content without response, I am getting Error: no response content type found for deserialization.
I am using 1.0.0-preview.75 versions of typescript library.

Thanks.

@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Nov 13, 2024
@baywet
Copy link
Member

baywet commented Nov 13, 2024

Hi @tonven
Thank you for using kiota and for reaching out.

What version of kiota has your client been generated with?

What was the last version of the package to work?

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question labels Nov 13, 2024
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Nov 13, 2024
@tonven
Copy link
Author

tonven commented Nov 14, 2024

@baywet Thank you for response!
In a kiota-lock file it says "kiotaVersion": "1.20.0"
.NET library is 1.14.0.
It did not work because it is a new project. First time trying kiota generator :)

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Nov 14, 2024
@baywet
Copy link
Member

baywet commented Nov 14, 2024

Thank you for the additional information.

Can you please, provide the snippet for the call you're making? as well as the API description.

Also, I'm a little confused, in your initial post you mentioned typescript version, and now a dotnet version?

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Nov 14, 2024
@tonven
Copy link
Author

tonven commented Nov 15, 2024

@baywet Sorry for missunderstanding. I am using .NET project to generate typescript classes for my backend. To be more concrete, I am using FastEndpoints library, which runs kiota generator. Here is the source code from the library that is used:

static async Task GenerateClient(IHost app, ClientGenConfig c, CancellationToken ct)
    {
        if (string.IsNullOrEmpty(c.SwaggerDocumentName))
            throw new InvalidOperationException("A Swagger document name is required for Api Client generation!");

        var logger = app.Services.GetRequiredService<ILogger<ClientGenerator>>();
        logger.LogInformation("Starting [{lang}] Api Client generation for [{doc}]", c.Language.ToString(), c.SwaggerDocumentName);

        var swaggerJsonPath = c.CleanOutput
                                  ? Path.Combine(Path.GetTempPath(), TempFolder)
                                  : c.OutputPath;

        c.OpenAPIFilePath = await ExportSwaggerJson(app, c.SwaggerDocumentName, swaggerJsonPath, null, ct);

        await new KiotaBuilder(
                logger: LoggerFactory.Create(_ => { }).CreateLogger<KiotaBuilder>(),
                config: c,
                client: new())
            .GenerateClientAsync(ct);

        logger.LogInformation("Api Client generation successful!");

        if (c.CreateZipArchive)
        {
            logger.LogInformation("Zipping up the generated client files...");

            c.ZipOutputFile ??= Path.Combine(c.OutputPath, $"..{Path.DirectorySeparatorChar}", $"{c.ClientClassName}.zip");

            if (File.Exists(c.ZipOutputFile))
                File.Delete(c.ZipOutputFile);

            ZipFile.CreateFromDirectory(c.OutputPath, c.ZipOutputFile, CompressionLevel.SmallestSize, false, Encoding.UTF8);

            logger.LogInformation("Client archive creation successful!");
        }
    }

Here is the response from calling this endpoint:
Image

Here is the api endpoint description:

"/api/register": {

      "post": {

        "tags": [

          "Api"

        ],

        "operationId": "ApiEndpointsUserManagementRegisterInternalUserRegisterEndpoint",

        "requestBody": {

          "x-name": "RegistrationRequest",

          "description": "",

          "content": {

            "application/json": {

              "schema": {

                "$ref": "#/components/schemas/ApiEndpointsUserManagementRegisterInternalUserRegistrationRequest"

              }

            }

          },

          "required": true,

          "x-position": 1

        },

        "responses": {

          "200": {

            "description": "Success",

            "content": {

              "text/plain": {

                "schema": {}

              },

              "application/json": {

                "schema": {}

              }

            }

          },

          "400": {

            "description": "Bad Request",

            "content": {

              "application/problem+json": {

                "schema": {

                  "$ref": "#/components/schemas/FastEndpointsErrorResponse"

                }

              }

            }

          }

        }

      }

    }

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Nov 15, 2024
@baywet
Copy link
Member

baywet commented Nov 15, 2024

Thank you for the additional information.

Oh wow, you've effectively build a client generation service 😮

Have you tried to generate the same client from the CLI instead and see if you're getting any difference? (in case there are differences in the setup of the builder)

Also, in your initial post you describe receiving a 204, but in the screenshot you're getting a 200. Can you double check and confirm which status code the client is receiving please?

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Nov 15, 2024
@tonven
Copy link
Author

tonven commented Nov 15, 2024

I am getting 200, i mixed up with another endpoint :)
Actually the client is working perfectly, thank you! I am just ignoring this error and checking that it is 200, so this is not to a big problem at all. Was just trying to find out if it dues to older version of .NET client or a bug.
I will try to run it using CLI tomorrow and will let you know with the result

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Nov 15, 2024
@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Nov 15, 2024

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
Status: Waits for author 🔁
Development

No branches or pull requests

2 participants