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

crow::json::dump does not exist? #271

Closed
FryingDutch opened this issue Nov 11, 2021 · 4 comments
Closed

crow::json::dump does not exist? #271

FryingDutch opened this issue Nov 11, 2021 · 4 comments

Comments

@FryingDutch
Copy link

Hi,

Have been using your lib for a while now, never had any issues.
However, when I want to get the string from a crow::json::wvalue, I receive this error.

#13 19.77 error: 'dump' is not a member of 'crow::json'
#13 19.77 34 | std::string jsonBody = crow::json::dump(x);

All other functions seem to work.

@luca-schlecker
Copy link
Collaborator

Isn't the dump function a member of crow::json::wvalue?

Crow/include/crow/json.h

Lines 1811 to 1818 in 4ac5892

public:
std::string dump() const
{
std::string ret;
ret.reserve(estimate_length());
dump_internal(*this, ret);
return ret;
}

@FryingDutch
Copy link
Author

You are correct! Doing x.dump() works.
Funny thing is, wherever I look for an example, crow::json::dump(x) is being used, which confused me.

@luca-schlecker
Copy link
Collaborator

Interesting, are these external or are they official Crow documentation? If they're from Crow, could you please link the faulty examples so we can get them fixed?

@The-EDev
Copy link
Member

The-EDev commented Nov 11, 2021

@luca-schlecker ipkn/crow had it as crow::json::dump. I had to change it when I added the returnable class (which was part of v0.3). The related PR is #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants