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

Mapping values are not allowed in this context #6024

Closed
dbheale opened this issue Jan 15, 2025 · 6 comments
Closed

Mapping values are not allowed in this context #6024

dbheale opened this issue Jan 15, 2025 · 6 comments
Labels
Csharp Pull requests that update .net code Needs: Attention 👋 type:question An issue that's a question

Comments

@dbheale
Copy link

dbheale commented Jan 15, 2025

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Windows executable

Client library/SDK language

Csharp

Describe the bug

I am getting the following error:
Error: KiotaBuilder OpenAPI error: #line=35 - (Lin: 35, Col: 26395, Chr: 27722) - (Lin: 35, Col: 26395, Chr: 27722): Mapping values are not allowed in this context.
My command:
kiota generate -d "https://localhost:44321/openapi/v1.json" -l csharp -n "FtSeriateConfiguration.Client.Kiota.ConfigurationService" --ebc -c ConfigurationApiClient --co -o "./Kiota
And I have a brand new API with only one endpoint. Here's my API doc:

{
  "openapi": "3.0.1",
  "info": {
    "title": "FtSeriateConfiguration.Server | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://localhost:44321"
    },
    {
      "url": "http://localhost:5249"
    }
  ],
  "paths": {
    "/api/user": {
      "get": {
        "tags": [
          "V1"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": { },
  "tags": [
    {
      "name": "V1"
    }
  ]
}

Expected behavior

I would expect a ConfigurationApiClient.cs file to be created within the FtSeriateConfiguration.Client.Kiota.ConfigurationService namespace under the relative Kiota folder.

How to reproduce

Use the provided JSON and run it through Kiota.

v1.json

Open API description file

No response

Kiota Version

1.22.3+a544276a5ee9d4a7b67cc0fbd5ce2804c172fa14

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

  • OS: Windows
  • Architecture: x64

Debug output

Click to expand log ```
</details>


### Other information

_No response_
@dbheale dbheale added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jan 15, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Jan 15, 2025
@msgraph-bot msgraph-bot bot added the Csharp Pull requests that update .net code label Jan 15, 2025
@baywet
Copy link
Member

baywet commented Jan 17, 2025

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

Thank you for your patience.

I did try to reproduce the issue with the description you provided and wasn't able to.

I've been using kiota version 1.22.3 as well.

Would you mind double checking what you provided is effectively what's causing the issue on your end please?

@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 and removed type:bug A broken experience status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jan 17, 2025
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Jan 17, 2025
@dbheale
Copy link
Author

dbheale commented Jan 17, 2025

@baywet thanks for getting back to me.

Does yours create an API Client? My output just looks like this:

Image

Here's the json I ran it against just now:

v1 (2).json

@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 Jan 17, 2025
@baywet
Copy link
Member

baywet commented Jan 17, 2025

Thank you for the additional information.

Yes, I do get a generated client in both cases.

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Jan 17, 2025
@dbheale
Copy link
Author

dbheale commented Jan 17, 2025

Is there anything obvious I'm missing? I've been using kiota for years, this is the first time I've had this issue.

@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 Jan 17, 2025
@dbheale
Copy link
Author

dbheale commented Jan 17, 2025

Sorry for wasting your time, it was an auth issue.

@dbheale dbheale closed this as completed Jan 17, 2025
@github-project-automation github-project-automation bot moved this from Waits for author 🔁 to Done ✔️ in Kiota Jan 17, 2025
@baywet
Copy link
Member

baywet commented Jan 17, 2025

no worries! thanks for the follow up!

@baywet baywet closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Csharp Pull requests that update .net code Needs: Attention 👋 type:question An issue that's a question
Projects
Status: Done ✔️
Development

No branches or pull requests

2 participants