map_request_body: Identify data types for each column in an input data...

Description Usage Arguments Details Value Examples

View source: R/open-api-spec.R

Description

The OpenAPI specification of a Plumber API created via plumber::pr() can be modified via plumber::pr_set_api_spec(), and this helper function will identify data types of predictors and create a list to use in this specification. These are not R data types, but instead basic JSON data types. For example, factors in R will be documented as strings in the OpenAPI specification.

Usage

1

Arguments

ptype

An input data prototype from a model

Details

This is a developer-facing function, useful for supporting new model types. It is called by api_spec().

Value

A list to be used within plumber::pr_set_api_spec()

Examples

1
map_request_body(vctrs::vec_slice(chickwts, 0))

tidymodels/vetiver documentation built on Jan. 14, 2022, 7:32 p.m.