Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not seem to convert Field's 'regex' to 'pattern' #55

Closed
hhartzer opened this issue Jul 7, 2023 · 5 comments · Fixed by #66
Closed

Does not seem to convert Field's 'regex' to 'pattern' #55

hhartzer opened this issue Jul 7, 2023 · 5 comments · Fixed by #66

Comments

@hhartzer
Copy link

hhartzer commented Jul 7, 2023

This is very cool! Unfortunately, it does not seem to convert 'regex' to 'pattern' for Field.

@Kludex
Copy link
Member

Kludex commented Jul 8, 2023

Do you have an MRE?

@hhartzer
Copy link
Author

hhartzer commented Jul 8, 2023

Do you have an MRE?

I can make one in a day or two! Will do.

@hhartzer
Copy link
Author

hhartzer commented Jul 9, 2023

from typing import Annotated

from pydantic import BaseModel, Field

class Thing(BaseModel):
    name: Annotated[str, Field(regex="^[A-Z]")]


print(Thing(name="Testing."))

@Kludex
Copy link
Member

Kludex commented Jul 9, 2023

Got it. Thanks. I'll fix it.

@hhartzer
Copy link
Author

Awesome! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants