Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: the C# client library generator does not use the 'sourceFolder' option when generate the test project code.

Đang mở
#12,751 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
csharp
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh với test.yaml và ConfigCodeGen.json, sau đó kiểm tra cách trình tạo C# chọn đường dẫn đầu ra cho mã của dự án kiểm thử so với dự án IO. Hoàn tất khi sourceFolder được cấu hình kiểm soát vị trí mã nguồn của dự án kiểm thử thay vì luôn đặt mã dưới src.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug

Description

The C# client library generator does not use the 'sourceFolder' option when generate the test project code.

Swagger Codegen Version

3.0.81

Language / Generator

csharp

OpenAPI/Swagger Spec

Content of the test.yaml file.

openapi: 3.0.0
info:
  version: "1.0.0"
  title: "Test"
paths:
  /status:
    get:
      operationId: getAssetStatus
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetStatus'
components:
  schemas:
    AssetStatus:
      type: object
      properties:
        live:
          type: boolean
      required:
        - live

Configuration file used

Content of the ConfigCodeGen.json file.

{
  "sourceFolder": "."
}

Command Line Used

java -jar swagger-codegen-cli.jar generate -l csharp -o code -c ConfigCodeGen.json -i test.yaml

Steps to Reproduce

  1. Run the generator using the command line specified and the indicated input files.

Expected Behavior

The generator should place the code of the test project in the folder specified through the configuration file as per the IO project.

Actual Behavior

The source code of the test project is place inside the 'src' folder regardless of the configuration.

Environment

  • OS: Windows 11;
  • Java Version: OpenJDK 26.0.1;
  • Build Tool: not builded by myself, I'm using the pre-build version;
  • Swagger Codegen CLI version: 3.0.81.

Checklist

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have included a minimal and reproducible spec example.
  • I have explained how to reproduce the issue.
  • I have specified which generator/language is affected.
Ngôn ngữ chính
Mustache
Star
17.8k
Fork
6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của swagger-api/swagger-codegen

Tất cả issue của swagger-api/swagger-codegen

Issue tương tự

Thêm issue về DevTools

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.