I believe the pattern matching described in #470 may no longer be compatible with PyLance. For example, creating a json schema like:
properties = {
'session': {
'type': 'string',
'pattern': '^((staging)|(production)):{0-9}+',
results in a PyDantic model:
class State(BaseModel):
session: Optional[constr(regex=r'^((staging)|(production)):{0-9}+')]
but this triggers
Call expression not allowed in type expression Pylance[reportInvalidTypeForm](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportInvalidTypeForm)
.
See this issue via PyLance for more detail.
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