OpenAPITools / OpenAPITools/openapi-generator

[REQ] Restyle R code

Open
#20,080 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hi @wing328 !

I'm looking into submitting an R package (laminr.api) generated by openapi-generator to CRAN.

There a few things that I think CRAN will comment on when I submit the package.

I'd like to make a couple of changes to the mustache templates for R to fix a couple of issues:

  • Small code style changes (e.g. using <- instead of = or seq_along(x) instead of 1:length(x))
  • Fix some issues with the roxygen docs (I get warnings like default_api.R:2961: @param requires two parts: an argument name and a description. when running devtools::document() so there are some minor things that need to be fixed)
  • Fix discrepancies between the httr and httr2 API client -- I see some slight differences in the way that the httr and httr2 versions are being rendered; would it make sense to align their mustache templates a little bit

I'll make sure to not modify the interface of the package as not to break anything for existing packages.

@wing328 : Is it okay if I send a couple of PRs your way? Would you prefer if send one big PR which you can review the changes all at once, or that I try to split up the work into multiple PRs which can reviewed separately?

Also @wing328: do you know of any other R packages that are already on CRAN that were generated by this generator?

Thanks for your input!
Robrecht

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the R mustache templates that render the httr and httr2 clients, then compare their generated output. Check the style changes and roxygen warnings by running devtools::document() on the generated package. Done means the generated R code follows the requested style, documentation warnings are fixed, the client renderings are aligned where appropriate, and the package interface is unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.