Skip to content

Commit 3f5f9a2

Browse files
committed
fix: Support attributes using builtin type names
Fixes openapi-generators#359
1 parent 17daa73 commit 3f5f9a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

openapi_python_client/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import builtins
12
import re
23
from keyword import iskeyword
34

@@ -15,7 +16,7 @@ def fix_keywords(value: str) -> str:
1516
return value
1617

1718

18-
RESERVED_WORDS = ("self",)
19+
RESERVED_WORDS = set(dir(builtins)).union({"self"})
1920

2021

2122
def fix_reserved_words(value: str) -> str:

0 commit comments

Comments
 (0)