I have a bunch of Exceptions that use the same interface, so it is easier for the frontend to distinct between them from the same endpoint.
I want to be able to document in swagger that MyWeirdExpection
has a property type
that has the value my-weird-exception
(it comes from an string ENUM if that is relevant).
Is this possible to do?
Something like:
enum MyEnum {
MyWeirdExpection: 'my-weird-exception',
RegularExpection: 'my-regular-expection'
... more
}
@ApiProperty({
description: 'Frontend can react on this property',
type: String, // <-----------WHAT HERE?
})
type: MyEnum.MyWeirdExpection;
Again, my goal is that in the swagger definition, says that MyWeirdExpection.type
is the constant 'my-weird-exception'