rstudio/plumber

Add ability to register a plumb block method

Open

#763 创建于 2021年2月5日

在 GitHub 查看
 (0 评论) (1 反应) (0 负责人)R (1,437 star) (257 fork)batch import
effort: mediumhelp wanted

描述

https://github.com/rstudio/plumber/blob/5d2070089849e05bb356537de266c2464b544a5f/R/plumb-block.R#L16-L243

☝️ has a lot of repetitive behaviors and is closed off to other developers.

It would be great if plumber (and others) could register the functions (similar to parsers and serializers) and allow them to parse a block independently.

Example:

#* @mycustomplumbertag key value value2

Thoughts:

  • Only a single line should be attempt at one time. (This is current behavior)
  • Once a block parser is a hit, the remaining block parsers should not attempted.
  • Don't know what should be supplied or be returned from the block parsers. There is a lot of global state that is currently being altered in the function above. This state should be continued throughout the block's parsing.
  • Should we be allowed to overwrite? Maybe a verbose argument? (like the parsers and serializers)
  • "block parser" or "plumb block" is a confusing name. Need a better one.

贡献者指南