Describe the bug
When creating a PlainSerializer a false positive of unresolved reference 'json' may be displayed.
'json' is a valid typing.Literal parameter.
Reference: https://docs.pydantic.dev/latest/concepts/serialization/#custom-serializers
I am assuming this is a plug-in issue and not an upstream PyCharm issue although I am not 100% sure.
Expected behavior
When when_used="json"
is provided no warning is displayed.
Environments (please complete the following information):
PyCharm 2023.2.4 (Professional Edition)
Build #PY-232.10203.26, built on October 31, 2023
Runtime version: 17.0.8.1+7-b1000.32 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.5.10-300.fc39.x86_64
Non-Bundled Plugins:
com.koxudaxi.ruff (0.0.25)
net.ashald.envfile (3.4.1)
com.koxudaxi.pydantic (0.4.9)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too