Skip to content

Add Literal supports for string constants#30

Merged
bogdandm merged 7 commits intopydanticfrom
pydantic-literals
May 4, 2020
Merged

Add Literal supports for string constants#30
bogdandm merged 7 commits intopydanticfrom
pydantic-literals

Conversation

@bogdandm
Copy link
Copy Markdown
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
Copy Markdown

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 force-pushed the pydantic-literals branch from 252e691 to 925c7bd Compare May 4, 2020 15:39
@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.

2 participants