SInce few days the default value provided for an ENUM is no more showing in the swagger
Before :

now:

@router.post('/a', response_model=Something)
async def endpoint_a(user: Something2,
keep_option: KeepOption = KeepOption.KEEP_NO_MISCLASSIFIED_ADS,
limit: Optional[int] = None):
Also a field limit:Optional[int] = None is not considered optional in the swagger

It's maybe only related to swagger-ui , do you have any idee ? thank you
The problem seems to be in pydantic : https://github.com/samuelcolvin/pydantic/pull/1749
Exactly
It seems to be due to a change of enum schema, which came in pydantic v1.6.
@mostaphaRoudsari made a very good statement in https://github.com/samuelcolvin/pydantic/pull/1749#issuecomment-662728965 to fix the doc generation.
correct with pydantic 1.7
Most helpful comment
Exactly
It seems to be due to a change of enum schema, which came in pydantic v1.6.
@mostaphaRoudsari made a very good statement in https://github.com/samuelcolvin/pydantic/pull/1749#issuecomment-662728965 to fix the doc generation.