You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a property name mediaType and a property mapping defining its data name as media_type, I get an error that mediaType is missing but it should be looking for media_type.
Please check v0.12.36 that now allows using mapped reflected names:
// Define default mapping.$ownerSchema->addPropertyMapping('media_type', static::names()->mediaType);
// Use mapped name references after the default mapping was configured.$names = self::names($ownerSchema->properties);
$ownerSchema->required = [$names->mediaType];
Seems like the property mapping needs to be applied here
Property mapping is mainly introduced to allow certain code style in PHP classes, but at the same time schema is portable and operates with "raw" data. To keep this portability (and interoperability with other languages) schema needs to be defined in terms of raw property names, and not as a runtime logic.
If I have a property name
mediaType
and a property mapping defining its data name asmedia_type
, I get an error thatmediaType
is missing but it should be looking formedia_type
.Example from my entity's
setUpProperties()
:Am I missing something or should this work the way I'm expecting? Seems like the property mapping needs to be applied here:
php-json-schema/src/Schema.php
Line 556 in d0126bd
The text was updated successfully, but these errors were encountered: