Skip to content

C# — Client generation fails if path ends with an HTTP Request Method word and contains an operation with such type. #2231

Closed

Description

Subject of the issue

C# Client generation fails if path ends with an HTTP Request Method word and contains an operation with such type. (check specification example for path "/me/get").

Your environment

  • Kiota --version: 0.10.0-preview+a7dce9b2945a106f1200bd0abd3b6de0a5965afc
  • OpenAPI specification: 3.0.X (JSON / YAML)

Steps to reproduce

  1. Create an OpenAPI Spec file named "example.yaml" with the following content:
openapi: 3.0.0
info:
  title: Microsoft Graph get user API
  version: 1.0.0
servers:
  - url: https://graph.microsoft.com/v1.0/
paths:
  /me:
    get:
      responses:
        200:
          description: Success!
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/microsoft.graph.user"
  /me/get:
    get:
      responses:
        200:
          description: Success!
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/microsoft.graph.user"
components:
  schemas:
    microsoft.graph.user:
      type: object
      properties:
        id:
          type: string
        displayName:
          type: string
  1. Run the following command: kiota generate --language csharp --openapi example.yaml

Expected behaviour

Generated C# Client with a method that contains the URL /me/get

Actual behaviour

An error occurs and the C# client is not generated as expected. The error message is shown in the attached screenshot.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

WIPgeneratorIssues or improvements relater to generation capabilities.type:bugA broken experience

Type

No type

Projects

  • Status

    Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions