Is your feature request related to a problem? Please describe.
The problem is how to share validation information as part of the schema.
What do I mean by validation?
mix_length or max_length on a string, or a regex pattern.
Describe the solution you'd like
dataclasses-avroschema es now able to add some metadata, my proposed solution is to also add the Field info from pydantic as part of the schema's metadata.
For example this schema, should include as part of the field's metadata also the min_length and pattern, etc:
from pydantic import BaseModel, Field
class Foo(BaseModel):
short: str = Field(min_length=3)
long: str = Field(max_length=10)
regex: str = Field(pattern=r'^\d*$')
Is your feature request related to a problem? Please describe. The problem is how to share validation information as part of the schema.
What do I mean by validation? mix_length or max_length on a string, or a regex pattern.
Describe the solution you'd like dataclasses-avroschema es now able to add some metadata, my proposed solution is to also add the
Field
info from pydantic as part of the schema's metadata.For example this schema, should include as part of the field's metadata also the
min_length
andpattern
, etc: