Skip to content

Commit

Permalink
Fix swagger examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Feb 4, 2025
1 parent ad62ddf commit 12cb7c1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/routers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,23 @@ def convert_to_checksum_address(cls, address: bytes):

class DataDecoderInput(CamelModel):
data: str = Field(
..., pattern=r"^0x[0-9a-fA-F]*$", description="0x-prefixed hexadecimal string"
pattern=r"^0x[0-9a-fA-F]*$",
description="0x-prefixed hexadecimal string",
examples=[
"0xa9059cbb0000000000000000000000005afe3855358e112b5647b952709e6165e1c1eeee00000000000000000000000000000000000000000000001e1de1d2517bae38ac"
],
)
to: ChecksumAddress | None = Field(
default=None, pattern=r"^0x[0-9a-fA-F]{40}$", description="Optional to address"
default=None,
pattern=r"^0x[0-9a-fA-F]{40}$",
description="Optional to address",
examples=["0x5aFE3855358E112B5647B952709E6165e1c1eEEe"],
)
chain_id: int | None = Field(
default=None,
gt=0,
description="Optional Chain ID as a positive integer",
examples=[1],
)

@field_validator("to")
Expand Down

0 comments on commit 12cb7c1

Please sign in to comment.