how to include specific private properties
Closed this issue · 1 comments
mech01nc01 commented
Hello,
i'm just trying your package and since now it looks really impressive
but now i have the following situation:
i have php-models, that have private properties BUT they are "accessible from public" (a small implementation with magic getters to only get the data loaded if needed)
is there a way (like [#Hidden] but the other way ^^) to tell your script to include them other then defining the whole typescript myself?
rubenvanassche commented
Implement your own DTOTransformer where you overwrite this method: https://github.com/spatie/typescript-transformer/blob/main/src/Transformers/DtoTransformer.php#L112-L120
And allow private properties. Don't forget to set the transformer within your config and remove the old one.