odata-client-php icon indicating copy to clipboard operation
odata-client-php copied to clipboard

Keys starting with an underscore are removed from the response

Open johanmolen opened this issue 3 years ago • 5 comments

Is there a reason for removing keys which start with an underscore? https://github.com/saintsystems/odata-client-php/blob/master/src/Entity.php#L701

Is there a way to override this behaviour?

johanmolen avatar Jan 26 '22 10:01 johanmolen

I think this behaviour is copied from Laravel. But this way odata keys starting with an underscore are removed :(

johanmolen avatar Jan 26 '22 15:01 johanmolen

Someone?

johanmolen avatar Feb 03 '22 07:02 johanmolen

This is an issue for me too - SAP S/4Hana Cloud API expands with underscore. So this library is currently not suitable for SAP Queries.

Here is an example for typical SAP query /sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0001/Product?$top=50&$expand=_ProductDescription,_ProductPlant

itspoonmkohv avatar Feb 04 '22 13:02 itspoonmkohv

@johanmolen, @itspoonmkohv yes, this is copied from Laravel Eloquent Model class. Confirming that there are no unintended consequences of removing this, but I think we'll be able to remove this to make it work.

anderly avatar Feb 04 '22 14:02 anderly

Perhaps https://github.com/laravel/framework/issues/6630 helps?

tavy315 avatar Feb 06 '22 19:02 tavy315