From 93225db82b1291883194be53318e238331b4e258 Mon Sep 17 00:00:00 2001 From: Ivelina Hristova Date: Thu, 25 Feb 2021 11:53:35 +0200 Subject: [PATCH] Add lib-api-bundle as replacement of lib-rest-bundle --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94446f2..af3c9cf 100644 --- a/README.md +++ b/README.md @@ -2198,6 +2198,10 @@ We can use class name as service ID (or alias it) when we are providing open-sou This allows others to use autowiring features if needed, even if we don't use them. We should only use this for public services - ones that are to be used outside of our bundle. +Exception: for controllers we use classname as service ID. +> **Why?** Because routing annotations work only when controller's service ID is it's classname +> (otherwise it has no way to know it). + #### Autoconfiguration and autowiring We don't use autowiring and autoconfiguration features of Dependency Injection component. @@ -3120,7 +3124,7 @@ Keep in mind that there are different skeletons for WEB, REST API and processing ### REST controllers -For REST controllers, we use [`PayseraRestBundle`](https://github.com/paysera/lib-rest-bundle) and normalizers. +For REST controllers, we use [`PayseraApiBundle`](https://github.com/paysera/lib-api-bundle) and normalizers. Controller methods return entities or scalar variables. @@ -3134,6 +3138,9 @@ We can use plain normalizer or plain item normalizer if needed. We use result provider to give `Result` entities from REST controller. +Response is automatically normalized using normalizer related to the classname of the returned object. +We could override it with additional annotation, if needed. + ### Extending model In server side we do not use subclasses and class-maps - we use services that give or process needed information.