Pydantic enum field does not get converted to string
I am trying to restrict one field in a class to an enum. However, when I try to get a dictionary out of class, it doesn't get converted to string. Instead it retains the enum. I checked pydantic documentation , but couldn't find anything relevant to my problem. This code is representative of what I actually need. from enum import Enum from pydantic import Ba