Skip to content

updating out of date api controller documentation#23

Open
MZandtheRaspberryPi wants to merge 1 commit intooatpp:masterfrom
MZandtheRaspberryPi:master
Open

updating out of date api controller documentation#23
MZandtheRaspberryPi wants to merge 1 commit intooatpp:masterfrom
MZandtheRaspberryPi:master

Conversation

@MZandtheRaspberryPi
Copy link

@MZandtheRaspberryPi MZandtheRaspberryPi commented Sep 24, 2022

I am new to oatpp and trying to use it for a project. I got some errors following some of the code snippets in the APIController documentation. This was mentioned on this issue by someone else: oatpp/oatpp#556.

Namely this gives me an error:

ENDPOINT("GET", "/users/{userId}", getUserById,
         PATH(Int64, userId)) 
{
  OATPP_LOGD("Test", "userId=%d", userId->getValue());
  return createResponse(Status::CODE_200, "OK");
}

error: request for member ‘getValue’ in ‘*(& userId)->oatpp::data::mapping::type::Primitive<long int, oatpp::data::mapping::type::__class::Int64>::<anonymous>.oatpp::data::mapping::type::ObjectWrapper<long int, oatpp::data::mapping::type::__class::Int64>::operator->()’, which is of non-class type ‘long int’
[build]    52 |   OATPP_LOGD("Test", "userId=%d", userId->getValue());

And this compiles:

ENDPOINT("GET", "/users/{userId}", getUserById,
         PATH(Int64, userId)) 
{
  OATPP_LOGD("Test", "userId=%d", *userId);
  return createResponse(Status::CODE_200, "OK");
}

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

Successfully merging this pull request may close these issues.

1 participant