rstudio / plumber

Turn your R code into a web API.
https://www.rplumber.io
Other
1.39k stars 256 forks source link

POST payload decorators and example parameters #867

Open tsheils opened 2 years ago

tsheils commented 2 years ago

Is it possible to annotate a post request with anything other than object or file? The backend works fine, but the OpenAPI documentation is inaccurate. Annotating the specific parameters builds them as a query request, but I'm dealing with large lists of parameters, so a long url won't work. I found this question from 4 years ago that says it isn't supported. Is this still the case?: https://community.rstudio.com/t/plumber-decorations-for-payload-parameter-in-body-of-a-request/16113

Is it possible to add examples as well?

meztez commented 9 months ago

@tsheils plumber does a really crude mapping of parameters to OpenAPI spec. For anything more complex, you will have to provide your own api spec.

https://www.rplumber.io/reference/pr_set_api_spec.html?q=pr_set_api_spec#ref-examples https://www.rplumber.io/articles/annotations.html#plumber-block-annotations