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();

which results in exception

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

If I place

         \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();


Please correct me, if im wrong!

Cheers, Frank