Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conversion from ‘ArduinoJson::V704HB42::detail::enable_if<true, ArduinoJson::V704HB42::JsonVariantConst>::type’ {aka ‘ArduinoJson::V704HB42::JsonVariantConst’} to ‘ArduinoJson::V704HB42::JsonDocument’ is ambiguous #2091

Closed
folkertvanheusden opened this issue May 14, 2024 · 1 comment
Labels
question v7 ArduinoJson 7

Comments

@folkertvanheusden
Copy link

folkertvanheusden commented May 14, 2024

Description
I've got:

class myobject {
public:
static myobject *deserialize(const JsonDocument j);
};

furthermore:

void wrapper(const JsonDocument j) {
    myobject *m = myobject::deserialize(j["myobject"]);
}

This results in the error shown in the topic:

error: conversion from ‘ArduinoJson::V704HB42::detail::enable_if<true, ArduinoJson::V704HB42::JsonVariantConst>::type’ {aka ‘ArduinoJson::V704HB42::JsonVariantConst’} to ‘ArduinoJson::V704HB42::JsonDocument’ is ambiguous

Troubleshooter's report

  1. The program uses ArduinoJson 7
  2. The issue happens at compile time
  3. The error is not in the list

Environment

  • Microcontroller: esp32 & x64
  • Core/Framework: arduino & posix
@folkertvanheusden
Copy link
Author

I learned that when loading, use JsonDocument and from then on use JsonVariant.

@bblanchon bblanchon added question v7 ArduinoJson 7 labels May 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question v7 ArduinoJson 7
Projects
None yet
Development

No branches or pull requests

2 participants