lganzzzo on master
codegen: Fix QUERY(TYPE, NAME, … (compare)
lganzzzo on minor_code_cleanup
lganzzzo on master
parser::Caret: code cleanup Merge pull request #703 from oa… (compare)
lganzzzo on minor_code_cleanup
parser::Caret: code cleanup (compare)
lganzzzo on fix_async_body_decoder
lganzzzo on master
SimpleBodyDecoder: Fix async me… Merge pull request #702 from oa… (compare)
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
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
ListValue
field as a list of strings
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:)
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 with
content-type: application/json`.
So it worked.
Hi everyone,
I have a DTO class which consists of fields with other DTO class and I want to access these fields recursively.
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.
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
Status::CODE_302
response, the oatpp server should listen on ports 80 and 443. What is the recommended method for doing this ?
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
Hello @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 ?
Yes, you have to listen on both ports.
And you have to add Interceptor
on port 80 to redirect to 443 - like here https://github.com/oatpp/website/blob/master/server/main/src/SitePath.hpp#L46
How to setup component - you can find here - https://github.com/oatpp/website/blob/master/server/main/src/AppComponent.hpp