11from dataclasses import dataclass , field
22from datetime import datetime
3- from typing import List , Optional , cast
3+ from typing import List , Optional , Type , cast
44
55import marshmallow_dataclass
66from typing_extensions import Literal
@@ -21,12 +21,11 @@ class SCAIgnoredVulnerability(Base, FromDictMixin):
2121 path : str
2222
2323
24- SCAIgnoredVulnerability .SCHEMA = cast (
25- BaseSchema ,
26- marshmallow_dataclass .class_schema (
27- SCAIgnoredVulnerability , base_schema = BaseSchema
28- )(),
24+ SCAIgnoredVulnerabilitySchema = cast (
25+ Type [BaseSchema ],
26+ marshmallow_dataclass .class_schema (SCAIgnoredVulnerability , base_schema = BaseSchema ),
2927)
28+ SCAIgnoredVulnerability .SCHEMA = SCAIgnoredVulnerabilitySchema ()
3029
3130
3231@dataclass
@@ -37,21 +36,23 @@ class SCAScanParameters(Base, FromDictMixin):
3736 ignore_fixable : bool = False
3837
3938
40- SCAScanParameters . SCHEMA = cast (
41- BaseSchema ,
42- marshmallow_dataclass .class_schema (SCAScanParameters , base_schema = BaseSchema )() ,
39+ SCAScanParametersSchema = cast (
40+ Type [ BaseSchema ] ,
41+ marshmallow_dataclass .class_schema (SCAScanParameters , base_schema = BaseSchema ),
4342)
43+ SCAScanParameters .SCHEMA = SCAScanParametersSchema ()
4444
4545
4646@dataclass
4747class ComputeSCAFilesResult (Base , FromDictMixin ):
4848 sca_files : List [str ]
4949
5050
51- ComputeSCAFilesResult . SCHEMA = cast (
52- BaseSchema ,
53- marshmallow_dataclass .class_schema (ComputeSCAFilesResult , base_schema = BaseSchema )() ,
51+ ComputeSCAFilesResultSchema = cast (
52+ Type [ BaseSchema ] ,
53+ marshmallow_dataclass .class_schema (ComputeSCAFilesResult , base_schema = BaseSchema ),
5454)
55+ ComputeSCAFilesResult .SCHEMA = ComputeSCAFilesResultSchema ()
5556
5657
5758@dataclass
@@ -69,10 +70,11 @@ class SCAVulnerability(Base, FromDictMixin):
6970 ignore_comment : Optional [str ] = None
7071
7172
72- SCAVulnerability . SCHEMA = cast (
73- BaseSchema ,
74- marshmallow_dataclass .class_schema (SCAVulnerability , base_schema = BaseSchema )() ,
73+ SCAVulnerabilitySchema = cast (
74+ Type [ BaseSchema ] ,
75+ marshmallow_dataclass .class_schema (SCAVulnerability , base_schema = BaseSchema ),
7576)
77+ SCAVulnerability .SCHEMA = SCAVulnerabilitySchema ()
7678
7779SCADependencyType = Literal ["direct" , "transitive" ]
7880
@@ -86,12 +88,13 @@ class SCAVulnerablePackageVersion(Base, FromDictMixin):
8688 vulns : List [SCAVulnerability ] = field (default_factory = list )
8789
8890
89- SCAVulnerablePackageVersion . SCHEMA = cast (
90- BaseSchema ,
91+ SCAVulnerablePackageVersionSchema = cast (
92+ Type [ BaseSchema ] ,
9193 marshmallow_dataclass .class_schema (
9294 SCAVulnerablePackageVersion , base_schema = BaseSchema
93- )() ,
95+ ),
9496)
97+ SCAVulnerablePackageVersion .SCHEMA = SCAVulnerablePackageVersionSchema ()
9598
9699
97100@dataclass
@@ -100,12 +103,13 @@ class SCALocationVulnerability(Base, FromDictMixin):
100103 package_vulns : List [SCAVulnerablePackageVersion ] = field (default_factory = list )
101104
102105
103- SCALocationVulnerability . SCHEMA = cast (
104- BaseSchema ,
106+ SCALocationVulnerabilitySchema = cast (
107+ Type [ BaseSchema ] ,
105108 marshmallow_dataclass .class_schema (
106109 SCALocationVulnerability , base_schema = BaseSchema
107- )() ,
110+ ),
108111)
112+ SCALocationVulnerability .SCHEMA = SCALocationVulnerabilitySchema ()
109113
110114
111115@dataclass
@@ -115,10 +119,11 @@ class SCAScanAllOutput(Base, FromDictMixin):
115119 found_package_vulns : List [SCALocationVulnerability ] = field (default_factory = list )
116120
117121
118- SCAScanAllOutput . SCHEMA = cast (
119- BaseSchema ,
120- marshmallow_dataclass .class_schema (SCAScanAllOutput , base_schema = BaseSchema )() ,
122+ SCAScanAllOutputSchema = cast (
123+ Type [ BaseSchema ] ,
124+ marshmallow_dataclass .class_schema (SCAScanAllOutput , base_schema = BaseSchema ),
121125)
126+ SCAScanAllOutput .SCHEMA = SCAScanAllOutputSchema ()
122127
123128
124129@dataclass
@@ -129,7 +134,8 @@ class SCAScanDiffOutput(Base, FromDictMixin):
129134 removed_vulns : List [SCALocationVulnerability ] = field (default_factory = list )
130135
131136
132- SCAScanDiffOutput . SCHEMA = cast (
133- BaseSchema ,
134- marshmallow_dataclass .class_schema (SCAScanDiffOutput , base_schema = BaseSchema )() ,
137+ SCAScanDiffOutputSchema = cast (
138+ Type [ BaseSchema ] ,
139+ marshmallow_dataclass .class_schema (SCAScanDiffOutput , base_schema = BaseSchema ),
135140)
141+ SCAScanDiffOutput .SCHEMA = SCAScanDiffOutputSchema ()
0 commit comments