Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 05 23:51
    kekxv closed #661
  • Dec 05 06:44
    Naamanly edited #75
  • Dec 05 06:42
    Naamanly opened #75
  • Dec 04 00:10
    kekxv commented #295
  • Nov 30 20:08
    DanielHerchenbach commented #666
  • Nov 30 16:44
    DanielHerchenbach commented #666
  • Nov 30 16:03
    DanielHerchenbach edited #671
  • Nov 30 16:02
    DanielHerchenbach edited #671
  • Nov 30 15:58
    DanielHerchenbach opened #671
  • Nov 30 14:33
    DanielHerchenbach opened #670
  • Nov 30 13:11
    DanielHerchenbach opened #669
  • Nov 30 12:53
    DanielHerchenbach opened #668
  • Nov 30 12:21
    DanielHerchenbach commented #666
  • Nov 30 10:28
    rozmansi commented #528
  • Nov 30 07:27
    fwh-dc commented #665
  • Nov 30 06:54
    cyang-catalogicsoftware commented #662
  • Nov 30 05:54
    cyang-catalogicsoftware commented #662
  • Nov 30 05:47
    atokama commented #331
  • Nov 29 23:40
    lganzzzo labeled #666
  • Nov 29 23:40
    lganzzzo labeled #666
oat++
@oatpp_io_twitter
Hello @khazarmammadli , it should be possible to use relative paths - relative to executable
Please let me know if it worked
khazarmammadli
@khazarmammadli
Tried a few times with different functions but couldn’t seem to get it working, had to fall back to absolute paths
Another wuestion I have is if it possible to use the framework together with Address Sanitizer and Thread Sanitizer(The first one doesn’t seem to start the server aka getting only empty replies from the server and second one is having linkage errors as can’t find functions in oat++). Has anybody had experience with these? (i’ll attach the error messages as soon as possible)
khazarmammadli
@khazarmammadli
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::api::ApiController::getEndpointInfo(std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::api::ApiController::setEndpointInfo(std::
1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > const&, std::1::shared_ptr<oatpp::web::server::api::Endpoint::Info> const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::api::ApiController::getEndpointHandler(std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::api::ApiController::setEndpointHandler(std::
1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > const&, std::1::shared_ptr<oatpp::web::server::HttpRequestHandler> const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::api::Endpoint::createShared(std::1::shared_ptr<oatpp::web::server::HttpRequestHandler> const&, std::1::function<std::__1::shared_ptr<oatpp::web::server::api::Endpoint::Info> ()> const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::base::Environment::log(unsigned int, std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > const&, std::1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::base::memory::MemoryPool::MemoryPool(std::
1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > const&, long, long) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::base::memory::ThreadDistributedMemoryPool::ThreadDistributedMemoryPool(std::
1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > const&, long, long, long) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::data::mapping::type::Type::Type(oatpp::data::mapping::type::ClassId const&, char const, void, std::
1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> >, oatpp::data::mapping::type::Type::AbstractInterpretation const*, std::1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > >, std::1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > >, std::1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::1::allocator<char> > const, oatpp::data::mapping::type::Type::AbstractInterpretation const*> > >&&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::HttpConnectionHandler::createShared(std::
1::shared_ptr<oatpp::web::server::HttpRouterTemplate<std::__1::shared_ptr<oatpp::web::server::HttpRequestHandler> > > const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::server::api::ApiController::addEndpointsToRouter(std::1::shared_ptr<oatpp::web::server::HttpRouterTemplate<std::1::shared_ptr<oatpp::web::server::HttpRequestHandler> > > const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::protocol::http::outgoing::StreamingBody::StreamingBody(std::1::shared_ptr<oatpp::data::stream::ReadCallback> const&) [--no-allow-shlib-undefined]
ld.lld: error: ../../../lib/librest.so: undefined reference to oatpp::web::protocol::http::outgoing::Response::createShared(oatpp::web::protocol::http::Status const&, std::
1::shared_ptr<oatpp::web::protocol::http::outgoing::Body> const&) [--no-allow-shlib-un
oat++
@oatpp_io_twitter
@khazarmammadli , please post formatted messages. Please format error message as a code-block

Tried a few times with different functions but couldn’t seem to get it working, had to fall back to absolute paths

When oatpp::swagger::Resources tries to load files and it can't find them it prints out the path it's trying to use.
You may try to use it to debug files loading

shijiantouzouyiqie
@shijiantouzouyiqie
Hello everyone, there is an error using JSON structure, the server sends "ListValue[{}]" data without problem.
When the front-end browser sends a message, code=500 is displayed during server parsing.
What is the reason for this? Is there a better solution?
Server-side JSON data structure:
class DataReq: public oatpp::DTO {
    DTO_INIT(DataReq, DTO);
    DTO_FIELD(oatpp::String, Name);
    DTO_FIELD(oatpp::String, Value);
    DTO_FIELD(oatpp::List<oatpp::String>, ListValue);
    DTO_FIELD(oatpp::String, Enable);
};
class RequestDto: public oatpp::DTO {
    DTO_INIT(RequestDto, DTO);
    DTO_FIELD(oatpp::String, Com);
    DTO_FIELD(oatpp::Object<DataReq>, Data);
};
The data structure sent by the front end:
{
    "Com":"Set",
    "Data":{
        "Name":"List",
        "Value":"",
        "ListValue":[{
                "Index":"0",
            },{
                "Index":"1",
            }],
        "Enable":""
    }
}

Error message received by the front-end:
server=oatpp/1.3.0
code=500
description=Internal Server Error
message=[oatpp::parser::json::Utils::preparseString()]: Error. '"' - expected
shijiantouzouyiqie
@shijiantouzouyiqie
@oatpp_io_twitter May I ask if you have a better way?
oat++
@oatpp_io_twitter
Hey @shijiantouzouyiqie ,
You drclared ListValue field as a list of strings
But in JSON are sending it as a list of objects
You have to whether fix json or the data structure
1 reply
Kevin Benson
@kevinbenson1
Hello everyone. Is there a plan to tag a new release of oat++ anytime soon? There are some changes that have been committed since 1.3.0 that I would like to pull into our software. If it will be a while, I will just upgrade to 1.3.0 and add them as patches. In general, is additional testing performed on tagged releases? If not, maybe I will just pull in the latest trunk.
EnderTheCoder
@EnderTheCoder
image.png
Guys I was trying to use oatpp ADD_CORS()
it didn't seem to work on my reponse
image.png
any idea?
also i searched out every one of your example repos, I didn't see any that uses this micro param.
oat++
@oatpp_io_twitter

Hello @kevinbenson1 ,

Hello everyone. Is there a plan to tag a new release of oat++ anytime soon? There are some changes that have been committed since 1.3.0 that I would like to pull into our software. If it will be a while, I will just upgrade to 1.3.0 and add them as patches. In general, is additional testing performed on tagged releases? If not, maybe I will just pull in the latest trunk.

In the nearest two month there will be no new tag.
I suggest taking the latest master.
While we do additional testing on tag-builds, we encourage community to use the latest master and report bugs. - Crowd testing:)

1 reply

Hello @EnderTheCoder ,

Guys I was trying to use oatpp ADD_CORS()
it didn't seem to work on my reponse

From your screenshot - there is a response from oatpp server withcontent-type: application/json`.
So it worked.

oat++
@oatpp_io_twitter
Since there is a connection: close header (in the current implementation oatpp closes connection on unhandled errors) I assume that your service responded with error
But it's not the CORS problem
EnderTheCoder
@EnderTheCoder
okay, i got it, thanks for your help
oat++
@oatpp_io_twitter
Hello @emrahhisir , please format your post as a code snippet (see markdown formatting). Otherwise it's hard to read it
Emrah Hışır
@emrahhisir

Hi everyone,
I have a DTO class which consists of fields with other DTO class and I want to access these fields recursively.

Example DTO class:

class DTOSample : public oatpp::DTO {

  DTO_INIT(DTOSample, DTO /* Extends */)

  DTO_FIELD(Vector<Object<DTOSampleInner>>, inner);
};

class DTOSampleInner : public oatpp::DTO {

  DTO_INIT(DTOSampleInner, DTO /* Extends */)

  DTO_FIELD(String, name);
  DTO_FIELD(String, value);
};

accessFields(const oatpp::data::mapping::type::DTOWrapper<T> dto) {
    auto object = static_cast<oatpp::BaseObject *>(dto.get());
    auto fields = dto.getPropertiesList();
    for (auto const &field : fields) {
        auto value = field->get(object);
        // How can access name and value fields of DTOSampleInner
    }
}

Thanks.

oat++
@oatpp_io_twitter

Hello @emrahhisir ,

for (auto const &field : fields) {
  auto value = field->get(object);
  if(value.getValueType() == oatpp::data::mapping::type::__class::AbstractObject::CLASS_ID.id) {
          auto dispatcher = static_cast<const type::__class::AbstractObject::PolymorphicDispatcher*>(baseType->polymorphicDispatcher);
          const auto& map = dispatcher->getProperties()->getMap(); // <--- And again you get the properties map
  }
}

And since you have Vector of objects - you have first access items of the vector

Best place to search for code examples on this matter - is json serializer:
Emrah Hışır
@emrahhisir
Thanks @oatpp_io_twitter. I customized code in Serializer.cpp.
EnderTheCoder
@EnderTheCoder
Hello everyone. I'm looking for help with oatpp-postgresql model. I did not query with any Float32 param, but an error was given tells that it had problems with Float32 parsing. Do you have any ideas about this?
Here's my QUERY:
image.png
db usage:
image.png
error given by orm framework:
image.png
server=oatpp/1.3.0
code=500
description=Internal Server Error
message=[oatpp::postgresql::mapping::Deserializer::deserializeFloat32()]: Error. Unknown OID.
here's the table:
image.png
I'm pretty sure all data types I used are supported by oatpp-postgresql framework.
EnderTheCoder
@EnderTheCoder
Also, another query with this table worked well. So I don't think it's a problem with the table.
EnderTheCoder
@EnderTheCoder
Never mind, it's a table problem. Sorry for my stupid mistake.
Jan Weßling
@frosk1

Hey,

does the c++ web framework oat++ needs to be serverd via an external webserver over CGI/ FastCGI or does oat++ comes with its own http web server?

oat++
@oatpp_io_twitter
Hello @frosk1 , Oat++ comes with its own http web server
Jan Weßling
@frosk1
thx @oatpp_io_twitter understood. Are there any benchmarks of this http web server vs some other languages like python (gunicorn server, uswgi server, etc.) or go( gin http server) ?
Fabrice Aeschbacher
@fabrice.aeschbacher_gitlab
I'm looking for a way to redirect http requests (port=80) to my oatpp https server listening on port 443. To be able to send a Status::CODE_302 response, the oatpp server should listen on ports 80 and 443. What is the recommended method for doing this ?
oat++
@oatpp_io_twitter

Hey @frosk1 ,

thx @oatpp_io_twitter understood. Are there any benchmarks of this http web server vs some other languages like python (gunicorn server, uswgi server, etc.) or go( gin http server) ?

For oatpp 1.1.0 - https://www.techempower.com/benchmarks/#section=data-r21&test=json
Also you may search on github - there must be some repos with benchmarks like this one https://github.com/memen45/server_benchmark