Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG][R] Generated samples/client/echo_api/r cannot be run

オープン 初心者向け
#24,816 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
r
領域
testing-qa

調査の方向性

samples/client/echo_api/r/R/data_query.R の37行目から始め、devtools::test() で失敗を再現します。bin/configs/r-echo-api.yaml のサンプル設定と、動作する R クライアントのテスト設定を比較し、その後 = [SUCCESS, FAILURE] を生成する R テンプレートのパスを追跡します。生成された echo_api R パッケージが読み込まれ、そのテストが構文エラーなしで実行されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

The generated echo_api client for R breaks out of the box because of invalid R syntax:

https://github.com/OpenAPITools/openapi-generator/blob/4242641f766d500f3ffb48a5481e1f63866a1f1c/samples/client/echo_api/r/R/data_query.R#L37

The = [SUCCESS, FAILURE] has the appearance of Python code that has snuck in.

openapi-generator version

This is found in the master branch and is an issue in generated integration test code, not an issue found actually running the generator.

OpenAPI declaration file content or url

NA; this is an integration test bug

Generation Details

NA; this is an integration test bug

Steps to reproduce

Navigating to samples/client/echo_api/r, trying to load the package or run tests fails because of the syntax error:

r % Rscript -e 'devtools::test()'
ℹ Testing openapi
Error in `load_all()`:
! Failed to load R/data_query.R
Caused by error in `parse()`:
! At R/data_query.R:37:53: unexpected '['
36:     #' @param ... Other optional arguments.
37:     initialize = function(`id` = NULL, `outcomes` = [
Related issues/PRs

Not found

Suggest a fix

I am not quite sure what template source is responsible for this errant R code. According to

https://github.com/OpenAPITools/openapi-generator/blob/4242641f766d500f3ffb48a5481e1f63866a1f1c/bin/configs/r-echo-api.yaml#L4

this uses the same template as the working petstore R client tests; however, the latter three all use settings

  exceptionPackage: rlang
  useRlangExceptionHandling: true
  returnExceptionOnFailure: true

do to which they are following a quite different code generation path that might bypass wherever the issue is. I don't see SUCCESS or FAILURE anywhere in that template directory so I couldn't trace it back any further than that.

主要言語
Java
スター
26.8k
フォーク
7.7k
平均マージ
3日 16時間
マージ済み PR(30日)
122

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenAPITools/openapi-generator のほかの issue

OpenAPITools/openapi-generator の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。