Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #330
Closed
Open
Issue created Aug 11, 2016 by Administrator@rootContributor

is<char*>() should return true for null

Created by: gerikintercede

There is no way to test for "key":null in a JsonVariant. JsonVariant().is< char* >() returns false as expected, so is no use. JsonVariant().asString() returns NULL, but it will also return NULL for "key":1, so is no use.

Needs something like:

inline bool JsonVariant::isNull() const {
  using namespace Internals;
  return (_type == JSON_UNPARSED && _content.asString &&
      !strcmp("null", _content.asString));
}

However, this also needs bool JsonVariant::is< void* >();, or possibly class JsonNull; bool JsonVariant::is< JsonNull >();

Also there are no tests in JsonVariant_As_Tests.cpp and JsonVariant_Is_Tests.cpp for "key":null .

Assignee
Assign to
Time tracking