Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 08 09:17
    bamkrs edited #410
  • Apr 08 09:17
    bamkrs reopened #410
  • Apr 08 09:17
    bamkrs commented #410
  • Apr 08 05:44
    AustinDeng closed #410
  • Apr 08 05:44
    AustinDeng commented #410
  • Apr 07 16:18
    bamkrs commented #410
  • Apr 07 15:42
    AustinDeng opened #410
  • Apr 06 18:37
    Maximsiv1410 closed #409
  • Apr 06 18:37
    Maximsiv1410 commented #409
  • Apr 06 18:30
    lganzzzo commented #409
  • Apr 06 18:12
    Maximsiv1410 edited #409
  • Apr 06 18:11
    Maximsiv1410 opened #409
  • Apr 06 15:31
    elgatito opened #44
  • Apr 05 17:27
    lganzzzo commented #5
  • Apr 05 17:26
    lganzzzo commented #5
  • Apr 05 15:32
    acidtonic commented #5
  • Apr 05 09:57
    jmml97 opened #408
  • Apr 02 20:14

    lganzzzo on types_refactoring

    oatpp::String: more convenient … (compare)

  • Mar 31 20:50
    lganzzzo commented #405
  • Mar 31 16:59
    luisfvieirasilva commented #405
oat++
@oatpp_io_twitter
Hey @ke9 , please find the oatpp/oatpp#149 I've added to track the progress on vcpkg support.
oat++
@oatpp_io_twitter
@/all - one more update. FYI - I started to work on oatpp/oatpp#150 - support for retires in RequestExecutor for ApiClient.
pooya
@pouyapanahandeh
Hi, I have some basic questions, the most important one is: how we can create the project, is it like Django, has any command line to create a project or not? I check the website but couldn't find anything, it would be great if someone explains it to me.
oat++
@oatpp_io_twitter
Hello @pouyapanahandeh , please checkout the starter project https://github.com/oatpp/oatpp-starter
This is a basic project with hello world endpoint
All you need is install oatpp. Checkout the starter and modify it to your needs
Please let me know if you have more questions
pooya
@pouyapanahandeh
@oatpp_io_twitter thanks for your help,
For example in Django we have the following command to create a project:
django-admin startproject mysite
How we can create the project with oatpp, I checked the link but I didn't get it well. you mean we have to clone the repo and use it as a starter project or it's an example of how the project looks like in oatpp?
oat++
@oatpp_io_twitter
Yes, you are right - just clone the stater and modify it to your needs.
Currently there is no oatpp-admin like in django. But it is a good idea to have one in future
@pouyapanahandeh
Starter is just a boilerplate precreated for you to start easier
pooya
@pouyapanahandeh
now I got it, one more question, do you have any doc how to set up the web app that written in oatpp on AWS or Azure?
oat++
@oatpp_io_twitter
Yes, there is no specific env setup for clouds. You can find some info here https://oatpp.io/docs/installation/unix-linux/
Basically you have to install c++ compiler and oatpp
Build your app and its done
However there might be some additional things depending on the OS you choose
pooya
@pouyapanahandeh
I got it, Thanks a lot for your help and time
oat++
@oatpp_io_twitter
Just text me if you face any problems. It would be helpfull for the project to know all the potential issues
pooya
@pouyapanahandeh
Sure, I will
Panda805
@Panda805
Hi ,there.
Can you tell me your por in detail?
oat++
@oatpp_io_twitter
Hello @Panda805 ,
Please specify what exactly you want to know?
I'll be happy to share the info
Marco Leclerc
@ke9
hi, anyone familiar with oatpp-consul?
oat++
@oatpp_io_twitter
Hello @ke9 what do you need a help with ?
Marco Leclerc
@ke9
hi, wondering if the deserializer in the Client class should allow unknown fields instead of not allowing them
new fields added to an API would break "older" DTO code
I'm working on adding support for sessions in the Client
Marco Leclerc
@ke9
oat++
@oatpp_io_twitter

@ke9 ,

I think that you are right. It is better to have allowUnknownFields == true for better compatibility with Consul API.

RES
@madkote
hello here, is there a recommendation which async redis client can be used (or better fits into) in aot++ framework?
and a usage example would be also very helpful... Thanks in advance!
oat++
@oatpp_io_twitter

Hello @madkote ,

I don't have any direct recommendations, but there are some points to consider:

  • If you are using oatpp Simple API - then it should be very easy to use any Redis client, and the process of integration should be straight forward.
  • If you are using oatpp Async API - then things become more complicated because, in oatpp-coroutines, you have to user oatpp-coroutines based API. It also depends on what kind of Redis API you are planning to use...
    • Redis Key-Value - you'll need to do additional synchronization code. All Redis read/write should be done in the separate thread, and coroutine should wait asynchronously for the result from that thread.
    • Pub/Sub - should be comparably easy to implement. You publish from a separate thread. If there is a message for subscriber, you spawn new oatpp-coroutine to handle that message.

Something like that...
Please let me know if you have more questions.

RES
@madkote
@oatpp_io_twitter thx for reply.
Simple API is clear. regarding async - I would like to avoid running redis commands in threads, therfore my question if there is any recommendation for native async redis lib.
I will look around.. thx
MJLHThomassen-Sorama
@MJLHThomassen-Sorama
Hello, i have a question regarding DTO's and inheritance.
I have 2 DTO's, one "Base" and one that inherits from this. As i udnerstand it, i need to pass the class name that gets inherited from to DTO_EXTENDS like this
DTO_INIT(ChildDto, BaseDto)
instead of
DTO_INIT(ChildDto, Object)
when i do this, i get runtime errors trying to access a property of the BaseDto on an instance of ChildDto
Also, maybe this has to do with the fact that the property i try to access in the BaseDto definition is itself a Dto
class HeaderDto : public oatpp::data::mapping::type::Object
{
DTO_INIT(HeaderDto, Object)
        DTO_FIELD(Int64, time);

    };

    class ResponseDto : public oatpp::data::mapping::type::Object 
    {
        DTO_INIT(ResponseDto, Object)

        DTO_FIELD(HeaderDto::ObjectWrapper, header);
    };
i try to access field "time" on ResponseDto object via field "header"
so
auto dto = ResponseDto::createShared();
dto->header->time = 0;
oat++
@oatpp_io_twitter
Hello @MJLHThomassen-Sorama , and welcome.
Let me double-check this. Will get back to you shortly.
MJLHThomassen-Sorama
@MJLHThomassen-Sorama
Hey @oatpp_io_twitter , thanks!
oat++
@oatpp_io_twitter
Hey @MJLHThomassen-Sorama
please see the full working example:

#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include <iostream>

#include OATPP_CODEGEN_BEGIN(DTO)

class MyBaseDto : public oatpp::data::mapping::type::Object {

  DTO_INIT(MyBaseDto, Object)

  DTO_FIELD(String, myBaseDtoField);

};

class HeaderDto : public MyBaseDto /* Should also extend a class here */ {

  DTO_INIT(HeaderDto, MyBaseDto)

  DTO_FIELD(Int64, time);

};

class ResponseDto : public oatpp::data::mapping::type::Object {

  DTO_INIT(ResponseDto, Object)

  DTO_FIELD(HeaderDto::ObjectWrapper, header) = HeaderDto::createShared(); // Don't forger to initialize object

};

#include OATPP_CODEGEN_END(DTO)

void run() {

  auto dto = ResponseDto::createShared();
  dto->header->time = 0;
  dto->header->myBaseDtoField = "Hello base class";

  auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared();

  auto json = objectMapper->writeToString(dto);

  std::cout << json->c_str() << std::endl;

}

int main() {

  oatpp::base::Environment::init();
  run();
  oatpp::base::Environment::destroy();

  return 0;
}
MJLHThomassen-Sorama
@MJLHThomassen-Sorama
@oatpp_io_twitter ill try that, probably the initilizing the object went wrong, ill let you know if this works!