reagento / adaptix

An extremely flexible and configurable data model conversion library.
https://adaptix.readthedocs.io
Apache License 2.0
362 stars 24 forks source link

Possible bug in strip_annotated function #268

Closed lubaskinc0de closed 2 months ago

lubaskinc0de commented 4 months ago

what it should do?

def strip_annotated(value: N) -> N:
    if HAS_ANNOTATED and isinstance(value, BaseNormType) and value.origin == typing.Annotated:
        return strip_annotated(value)
    return value
zhPavel commented 2 months ago

Yes, this is a bug.

The code should looks like

def strip_annotated(value: N) -> N:
    if HAS_ANNOTATED and isinstance(value, BaseNormType) and value.origin == typing.Annotated:
        return strip_annotated(value.args[0])
    return value
Eclips4 commented 2 months ago

This function was removed in 5f0ffff6cf552c1ac63fcae5c939736baa7ea71a.