json_type: Query the JSON type

View source: R/json_type.R

json_typeR Documentation

Query the JSON type

Description

The JSON types are

  • null

  • true, false

  • integer

  • real

  • array

  • object

Usage

json_type(x, path = NULL)

Arguments

x

A JSON vector

path

Path to element. This must be a valid JSONpath expression. For example ⁠"$.a.b[0]⁠ extracts the 1 in ⁠{"a": {"b": [1, 2]}}⁠.

Value

A character vector of JSON types

Examples

json_type(c(NA, "1", "null", "[1,2]", '{"a": 1}'))

mgirlich/jsontools documentation built on March 21, 2023, 9:10 a.m.