[BUG][RUST] RustClientCodegen does not check RUST_POST_PROCESS_FILE or run rustfmt

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

Maintainer thường phản hồi trong vòng 1 ngày

@AnthemZach đang làm issue này rồi.

Từ ngày 10/11/2026.

  • #25614 của @AnthemZach — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, rust
Lĩnh vực
backend, tooling

Hướng nghiên cứu

Read the RustClient generator and compare its post-processing behavior with the RustAxum generator, which the issue identifies as the working example. Reproduce with the provided CLI command and cargo fmt --check; done means RustClient honors RUST_POST_PROCESS_FILE and formats generated code. An open linked pull request (#25614) already addresses the issue.

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

Mô tả

Issue: Bug
Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Clients generated with -g rust contain code that fails standard rust linting (e.g. cargo fmt --check and cargo clippy). The RustAxum generator already checks RUST_POST_PROCESS_FILE and Overrides postProcessFile to ensure rustfmt is run. The same method could be used for the RustClient generator.

openapi-generator version

v7.27.0 not a regression, I don't think this has ever worked.

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g rust -o /tmp/rust_api_client --enable-post-process-file
cd /tmp/rust_api_client/
cargo fmt --check # shows failures
Related issues/PRs
Suggest a fix
Ngôn ngữ chính
Java
Star
26.9k
Fork
7.8k
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
180

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 OpenAPITools/openapi-generator

Tất cả issue của OpenAPITools/openapi-generator

Issue tương tự

Thêm issue về Java

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.