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

Add Literal supports for string constants #30

Merged
merged 7 commits into from May 4, 2020
Merged

Conversation

bogdandm
Copy link
Owner

@bogdandm bogdandm commented May 3, 2020

  • Add support for s: Literal['foo', 'bar'] syntax.
  • Add API to customize typing code generation for any BaseType subclass

@coveralls
Copy link

coveralls commented May 3, 2020

Coverage Status

Coverage increased (+0.01%) to 98.505% when pulling 925c7bd on pydantic-literals into c50aca4 on pydantic.

@bogdandm bogdandm merged commit 7c5d79f into pydantic May 4, 2020
@bogdandm bogdandm deleted the pydantic-literals branch May 4, 2020 15:45
bogdandm added a commit that referenced this pull request May 4, 2020
* Add types_styles parameter

* Pydantic: rewrite string_serializable replace with actual types using types_style

* Integrate StringLiteral into core

* Pydantic: Implement StringLiteral logic

* Use StringLiteral for base generator and dataclass generator

* Add --max-strings-literals CLI arg

* Add test for type styles and string literals
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 this pull request may close these issues.

None yet

2 participants