mirror of
https://github.com/oatpp/oatpp.git
synced 2025-04-18 19:00:23 +08:00
Merge with master
This commit is contained in:
commit
e71c94a83d
@ -4,11 +4,11 @@
|
||||
# https://aka.ms/yaml
|
||||
|
||||
jobs:
|
||||
- job: ubuntu_16_04_mem_pool_on
|
||||
displayName: 'Build - Ubuntu 16.04 - With Memory Pool'
|
||||
- job: ubuntu_20_04_mem_pool_on
|
||||
displayName: 'Build - Ubuntu 20.04 - With Memory Pool'
|
||||
continueOnError: false
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
vmImage: 'ubuntu-20.04'
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
@ -25,11 +25,11 @@ jobs:
|
||||
displayName: 'Test'
|
||||
workingDirectory: build
|
||||
|
||||
- job: ubuntu_16_04_mem_pool_off
|
||||
displayName: 'Build - Ubuntu 16.04 - No Memory Pool'
|
||||
- job: ubuntu_20_04_mem_pool_off
|
||||
displayName: 'Build - Ubuntu 20.04 - No Memory Pool'
|
||||
continueOnError: false
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
vmImage: 'ubuntu-20.04'
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
|
@ -75,6 +75,11 @@ public:
|
||||
*/
|
||||
bool alwaysIncludeRequired = false;
|
||||
|
||||
/**
|
||||
* Always include array or map elements, even if their value is `nullptr`.
|
||||
*/
|
||||
bool alwaysIncludeNullCollectionElements = false;
|
||||
|
||||
/**
|
||||
* If `true` - insert string `"<unknown-type>"` in json field value in case unknown field found.
|
||||
* Fail if `false`.
|
||||
@ -142,7 +147,7 @@ private:
|
||||
bool first = true;
|
||||
|
||||
for(auto& value : *list) {
|
||||
if(value || serializer->getConfig()->includeNullFields) {
|
||||
if(value || serializer->getConfig()->includeNullFields || serializer->getConfig()->alwaysIncludeNullCollectionElements) {
|
||||
(first) ? first = false : stream->writeSimple(",", 1);
|
||||
serializer->serialize(stream, value);
|
||||
}
|
||||
@ -167,7 +172,7 @@ private:
|
||||
|
||||
for(auto& pair : *map) {
|
||||
const auto& value = pair.second;
|
||||
if(value || serializer->m_config->includeNullFields) {
|
||||
if(value || serializer->m_config->includeNullFields || serializer->m_config->alwaysIncludeNullCollectionElements) {
|
||||
(first) ? first = false : stream->writeSimple(",", 1);
|
||||
const auto& key = pair.first;
|
||||
serializeString(stream, key->data(), key->size(), serializer->m_config->escapeFlags);
|
||||
|
Loading…
x
Reference in New Issue
Block a user