Hide some fields for non logged user and get this information in swagger

20 views Asked by At

im trying to figure out that there is option to hide some fields by class serialize interceptor and see these excluded fields in swagger?

Now i have my own dectorator to serialize output but everytime i must write own DTO to transform response and create response type for swagger.

I speaking about scenario where we have product entity and for not logged user on route

/products/xyz/ response will be

{
   id: 1,
   name: “some product”,
}

and for logged user which bought product /user/products/ response will be

   [
      {
         id: 1,
         name: “some product”,
         file: “https://someurl”
      }
   ]
0

There are 0 answers