@@ -19,16 +19,16 @@ object TypeBuilder {
19
19
private [this ] val logger = getLogger
20
20
21
21
def collectModels (t : Type , alreadyKnown : Set [Model ], sfs : SwaggerFormats , et : Type )(implicit
22
- st : ShowType ): Set [Model ] =
22
+ st : ShowType ): Set [Model ] =
23
23
try collectModels(t.dealias, alreadyKnown, ListSet .empty, sfs, et)
24
24
catch { case NonFatal (_) => Set .empty }
25
25
26
26
private def collectModels (
27
- t : Type ,
28
- alreadyKnown : Set [Model ],
29
- known : TypeSet ,
30
- sfs : SwaggerFormats ,
31
- et : Type )(implicit st : ShowType ): Set [Model ] = {
27
+ t : Type ,
28
+ alreadyKnown : Set [Model ],
29
+ known : TypeSet ,
30
+ sfs : SwaggerFormats ,
31
+ et : Type )(implicit st : ShowType ): Set [Model ] = {
32
32
33
33
def go (t : Type , alreadyKnown : Set [Model ], known : TypeSet ): Set [Model ] =
34
34
t.dealias match {
@@ -50,7 +50,7 @@ object TypeBuilder {
50
50
go(tpe.typeArgs.last, alreadyKnown, known + tpe)
51
51
52
52
case tpe
53
- if (tpe.isCollection || tpe.isOption || tpe.isEffect(et)) && tpe.typeArgs.nonEmpty =>
53
+ if (tpe.isCollection || tpe.isOption || tpe.isEffect(et)) && tpe.typeArgs.nonEmpty =>
54
54
go(tpe.typeArgs.head, alreadyKnown, known + tpe)
55
55
56
56
case tpe if tpe.isStream =>
@@ -75,7 +75,7 @@ object TypeBuilder {
75
75
}.toSet
76
76
77
77
case tpe @ TypeRef (_, sym : Symbol , tpeArgs : List [Type ])
78
- if isCaseClass(sym) || isSumType(sym) =>
78
+ if isCaseClass(sym) || isSumType(sym) =>
79
79
val symIsSumType = isSumType(sym)
80
80
val maybeParentSumType = sym.asClass.baseClasses.drop(1 ).find(isSumType)
81
81
@@ -157,7 +157,7 @@ object TypeBuilder {
157
157
}
158
158
159
159
private def modelToSwagger (tpe : Type , sfs : SwaggerFormats )(implicit
160
- st : ShowType ): Option [ModelImpl ] =
160
+ st : ShowType ): Option [ModelImpl ] =
161
161
try {
162
162
val TypeRef (_, sym : Symbol , tpeArgs : List [Type ]) = tpe
163
163
val constructor = tpe.member(termNames.CONSTRUCTOR )
@@ -185,7 +185,7 @@ object TypeBuilder {
185
185
}
186
186
187
187
private def paramSymToProp (sym : Symbol , tpeArgs : List [Type ], sfs : SwaggerFormats )(pSym : Symbol )(
188
- implicit st : ShowType ): (String , Property ) = {
188
+ implicit st : ShowType ): (String , Property ) = {
189
189
val pType = pSym.typeSignature.substituteTypes(sym.asClass.typeParams, tpeArgs)
190
190
val required = ! (pSym.asTerm.isParamWithDefault || pType.isOption)
191
191
val prop = typeToProperty(pType, sfs)
@@ -245,15 +245,15 @@ object TypeBuilder {
245
245
object DataType {
246
246
247
247
case class ValueDataType (
248
- name : String ,
249
- format : Option [String ] = None ,
250
- qualifiedName : Option [String ] = None )
251
- extends DataType
248
+ name : String ,
249
+ format : Option [String ] = None ,
250
+ qualifiedName : Option [String ] = None )
251
+ extends DataType
252
252
case class ContainerDataType (
253
- name : String ,
254
- typeArg : Option [DataType ] = None ,
255
- uniqueItems : Boolean = false )
256
- extends DataType
253
+ name : String ,
254
+ typeArg : Option [DataType ] = None ,
255
+ uniqueItems : Boolean = false )
256
+ extends DataType
257
257
case class ComplexDataType (name : String , qualifiedName : Option [String ] = None ) extends DataType
258
258
case class EnumDataType (enums : Set [String ]) extends DataType { val name = " string" }
259
259
0 commit comments