rstudio/plumber

Add ability to register a plumb block method

Open

#763 aberto em 5 de fev. de 2021

Ver no GitHub
 (0 comments) (1 reaction) (0 assignees)R (257 forks)batch import
effort: mediumhelp wanted

Métricas do repositório

Stars
 (1.437 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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.

Guia do colaborador