Question about PropertyMappingConfiguration()->skipUnknownProperties()

Hello again!

Another stupid question …
One of my flow applications is a RESTful service.
It is doing its job as desired.

Now I want to enhance the “add” service by ignoring possible additional data sended by client.

Tried to implement this feature by definition of my own PropertyMappingConfiguration like this:

$configuration = new PropertyMappingConfiguration();
$configuration->skipUnknownProperties();

which results in exception

Creation of objects not allowed.
To enable this, you need to set the PropertyMappingConfiguration Value
"CONFIGURATION_CREATION_ALLOWED" to TRUE

If I place

   $configuration->setTypeConverterOption(\TYPO3\Flow\Property\TypeConverter\PersistentObjectConverter::class, 
         \TYPO3\Flow\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true );

it seems to work, but the result of

$this->propertyMapper->convert( $data, '\fsix\K2\Domain\Model\Article', $configuration );

is a dataset with all Article properties empty or NULL or 0:

Flow Variable Dump
fsix\K2\Domain\Model\Article prototype persistable proxy
 Persistence_Object_Identifier => string "f248f590-4591-42c0-a5ed-41bdbb3775a6" (36)
 itemnr => NULL
 name => NULL
 shortName => string "" (0)
 description => string "" (0)

My question: is this the totally wrong way to implement this feature?
Or do I have to set more TypeConverterOptions or …

(For additional info: $data is provied as a part of DTO.)

Any ideas?

Hi all!

Ok, got it!

The right way is as follows:

$configuration->allowProperties(<list of known properties>)->skipUnknownProperties();

in combination with “CONFIGURATION_CREATION_ALLOWED”.

Please correct me, if im wrong!

Cheers, Frank