[#nlohmann-basic_json-0c-accept-05] = xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic_json]::accept :relfileprefix: ../../ :mrdocs: check if the input is valid JSON == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> static bool accept( InputType&& i, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Return Value whether the input is valid JSON == Parameters [cols="1,4"] |=== | Name| Description | *i* | input to check | *ignore_comments* | whether comments should be ignored and treated like whitespace (`true`) or yield a parse error (`false`) | *ignore_trailing_commas* | whether trailing commas in arrays and objects should be ignored (`true`) or yield a parse error (`false`) |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#