Skip to content

Commit a8a2ab9

Browse files
authored
Merge pull request #60 from manchenkoff/#59-string-format-extension
Added common string formats into enum
2 parents 58abbfa + 35e1cad commit a8a2ab9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/openapi_parser/enumeration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class StringFormat(Enum):
3535
UUID = 'uuid'
3636
EMAIL = 'email'
3737
URI = 'uri'
38+
HOSTNAME = 'hostname'
39+
IPV4 = 'ipv4'
40+
IPV6 = 'ipv6'
41+
URL = 'url'
3842

3943

4044
@unique

tests/test_enumeration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def test_number_format_error() -> None:
6363
("uuid", StringFormat.UUID),
6464
("email", StringFormat.EMAIL),
6565
("uri", StringFormat.URI),
66+
("hostname", StringFormat.HOSTNAME),
67+
("ipv4", StringFormat.IPV4),
68+
("ipv6", StringFormat.IPV6),
69+
("url", StringFormat.URL),
6670
)
6771

6872

0 commit comments

Comments
 (0)