cakephp-dto icon indicating copy to clipboard operation
cakephp-dto copied to clipboard

Default payload type

Open telemmaite opened this issue 3 years ago • 2 comments

Hi, thank you for this package it helps enforce some structure & checks at edge level where it is needed but easily skipped!

Something that I find annoying when dealing with underscored/dashed, non default payloads, we always have to be very verbose

new MyDto($content, false, Dto::TYPE_UNDERSCORED);

Would be great if we can specify somewhere else those defaults. For example in the Dto schema

<dto name="MyDto" immutable="true" default_type="under_scored" ignore_missing="false">
...

telemmaite avatar Jan 27 '22 21:01 telemmaite

I like the idea. The only concern I have would be that this seems to easily set different defaults for different dtos And then it can become a mess and you never know what the defaults are.

dereuromark avatar Jan 27 '22 21:01 dereuromark

That said: Maybe we could offer a Configure based global kind of default that would generate them with what you best see fit for it?

dereuromark avatar Jan 30 '22 20:01 dereuromark

Can you test the linked PR? Does it work for you?

dereuromark avatar Sep 21 '23 09:09 dereuromark