Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit f860369

Browse files
committed
Adds type ignoring for enum values, schemas fixed
1 parent 3a6ffd2 commit f860369

File tree

45 files changed

+119
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+119
-119
lines changed

modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_enums.hbs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
@schemas.classproperty
55
def {{this}}(cls):
66
{{#eq @key.type "string"}}
7-
return cls("{{{@key.value}}}")
7+
return cls("{{{@key.value}}}") # type: ignore
88
{{/eq}}
99
{{#eq @key.type "number"}}
10-
return cls({{{@key.value}}})
10+
return cls({{{@key.value}}}) # type: ignore
1111
{{/eq}}
1212
{{#eq @key.type "integer"}}
13-
return cls({{{@key.value}}})
13+
return cls({{{@key.value}}}) # type: ignore
1414
{{/eq}}
1515
{{#eq @key.type "boolean"}}
1616
{{#if @key.value}}
17-
return cls(True)
17+
return cls(True) # type: ignore
1818
{{else}}
19-
return cls(False)
19+
return cls(False) # type: ignore
2020
{{/if}}
2121
{{/eq}}
2222
{{#eq @key.type "null"}}
23-
return cls(None)
23+
return cls(None) # type: ignore
2424
{{/eq}}
2525
{{/each}}
2626
{{/if}}

modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class classproperty:
155155
class NoneClass(Singleton):
156156
@classproperty
157157
def NONE(cls):
158-
return cls(None)
158+
return cls(None) # type: ignore
159159

160160
def __bool__(self) -> bool:
161161
return False
@@ -164,11 +164,11 @@ class NoneClass(Singleton):
164164
class BoolClass(Singleton):
165165
@classproperty
166166
def TRUE(cls):
167-
return cls(True)
167+
return cls(True) # type: ignore
168168

169169
@classproperty
170170
def FALSE(cls):
171-
return cls(False)
171+
return cls(False) # type: ignore
172172

173173
@functools.lru_cache()
174174
def __bool__(self) -> bool:

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Schema_:
4545

4646
@schemas.classproperty
4747
def BASQUE_PIG(cls):
48-
return cls("BasquePig")
48+
return cls("BasquePig") # type: ignore
4949
__annotations__ = {
5050
"className": ClassName,
5151
}

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean_enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ class Schema_:
3131

3232
@schemas.classproperty
3333
def TRUE(cls):
34-
return cls(True)
34+
return cls(True) # type: ignore

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Schema_:
5757

5858
@schemas.classproperty
5959
def COMPLEX_QUADRILATERAL(cls):
60-
return cls("ComplexQuadrilateral")
60+
return cls("ComplexQuadrilateral") # type: ignore
6161
__annotations__ = {
6262
"quadrilateralType": QuadrilateralType,
6363
}

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/currency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class Schema_:
3232

3333
@schemas.classproperty
3434
def EUR(cls):
35-
return cls("eur")
35+
return cls("eur") # type: ignore
3636

3737
@schemas.classproperty
3838
def USD(cls):
39-
return cls("usd")
39+
return cls("usd") # type: ignore

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Schema_:
4545

4646
@schemas.classproperty
4747
def DANISH_PIG(cls):
48-
return cls("DanishPig")
48+
return cls("DanishPig") # type: ignore
4949
__annotations__ = {
5050
"className": ClassName,
5151
}

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ class Schema_:
4343

4444
@schemas.classproperty
4545
def GREATER_THAN_SIGN_EQUALS_SIGN(cls):
46-
return cls(">=")
46+
return cls(">=") # type: ignore
4747

4848
@schemas.classproperty
4949
def DOLLAR_SIGN(cls):
50-
return cls("$")
50+
return cls("$") # type: ignore
5151

5252

5353
class ArrayEnum(
@@ -75,11 +75,11 @@ class Schema_:
7575

7676
@schemas.classproperty
7777
def FISH(cls):
78-
return cls("fish")
78+
return cls("fish") # type: ignore
7979

8080
@schemas.classproperty
8181
def CRAB(cls):
82-
return cls("crab")
82+
return cls("crab") # type: ignore
8383

8484
def __new__(
8585
cls,

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_class.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ class Schema_:
3636

3737
@schemas.classproperty
3838
def _ABC(cls):
39-
return cls("_abc")
39+
return cls("_abc") # type: ignore
4040

4141
@schemas.classproperty
4242
def HYPHEN_MINUS_EFG(cls):
43-
return cls("-efg")
43+
return cls("-efg") # type: ignore
4444

4545
@schemas.classproperty
4646
def LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS(cls):
47-
return cls("(xyz)")
47+
return cls("(xyz)") # type: ignore
4848

4949
@schemas.classproperty
5050
def COUNT_1M(cls):
51-
return cls("COUNT_1M")
51+
return cls("COUNT_1M") # type: ignore
5252

5353
@schemas.classproperty
5454
def COUNT_50M(cls):
55-
return cls("COUNT_50M")
55+
return cls("COUNT_50M") # type: ignore

samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ class Schema_:
4747

4848
@schemas.classproperty
4949
def UPPER(cls):
50-
return cls("UPPER")
50+
return cls("UPPER") # type: ignore
5151

5252
@schemas.classproperty
5353
def LOWER(cls):
54-
return cls("lower")
54+
return cls("lower") # type: ignore
5555

5656
@schemas.classproperty
5757
def EMPTY(cls):
58-
return cls("")
58+
return cls("") # type: ignore
5959

6060

6161
class EnumStringRequired(
@@ -75,15 +75,15 @@ class Schema_:
7575

7676
@schemas.classproperty
7777
def UPPER(cls):
78-
return cls("UPPER")
78+
return cls("UPPER") # type: ignore
7979

8080
@schemas.classproperty
8181
def LOWER(cls):
82-
return cls("lower")
82+
return cls("lower") # type: ignore
8383

8484
@schemas.classproperty
8585
def EMPTY(cls):
86-
return cls("")
86+
return cls("") # type: ignore
8787

8888

8989
class EnumInteger(
@@ -103,11 +103,11 @@ class Schema_:
103103

104104
@schemas.classproperty
105105
def POSITIVE_1(cls):
106-
return cls(1)
106+
return cls(1) # type: ignore
107107

108108
@schemas.classproperty
109109
def NEGATIVE_1(cls):
110-
return cls(-1)
110+
return cls(-1) # type: ignore
111111

112112

113113
class EnumNumber(
@@ -127,11 +127,11 @@ class Schema_:
127127

128128
@schemas.classproperty
129129
def POSITIVE_1_PT_1(cls):
130-
return cls(1.1)
130+
return cls(1.1) # type: ignore
131131

132132
@schemas.classproperty
133133
def NEGATIVE_1_PT_2(cls):
134-
return cls(-1.2)
134+
return cls(-1.2) # type: ignore
135135

136136
@staticmethod
137137
def string_enum() -> typing.Type[string_enum.StringEnum]:

0 commit comments

Comments
 (0)