Skip to content

Commit 480eae1

Browse files
author
Jarrod Young
committed
Formatting
1 parent 5a5e88c commit 480eae1

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

Diff for: swagger/src/main/scala/org/http4s/rho/swagger/TypeBuilder.scala

+18-18
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ object TypeBuilder {
1919
private[this] val logger = getLogger
2020

2121
def collectModels(t: Type, alreadyKnown: Set[Model], sfs: SwaggerFormats, et: Type)(implicit
22-
st: ShowType): Set[Model] =
22+
st: ShowType): Set[Model] =
2323
try collectModels(t.dealias, alreadyKnown, ListSet.empty, sfs, et)
2424
catch { case NonFatal(_) => Set.empty }
2525

2626
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] = {
3232

3333
def go(t: Type, alreadyKnown: Set[Model], known: TypeSet): Set[Model] =
3434
t.dealias match {
@@ -50,7 +50,7 @@ object TypeBuilder {
5050
go(tpe.typeArgs.last, alreadyKnown, known + tpe)
5151

5252
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 =>
5454
go(tpe.typeArgs.head, alreadyKnown, known + tpe)
5555

5656
case tpe if tpe.isStream =>
@@ -75,7 +75,7 @@ object TypeBuilder {
7575
}.toSet
7676

7777
case tpe @ TypeRef(_, sym: Symbol, tpeArgs: List[Type])
78-
if isCaseClass(sym) || isSumType(sym) =>
78+
if isCaseClass(sym) || isSumType(sym) =>
7979
val symIsSumType = isSumType(sym)
8080
val maybeParentSumType = sym.asClass.baseClasses.drop(1).find(isSumType)
8181

@@ -157,7 +157,7 @@ object TypeBuilder {
157157
}
158158

159159
private def modelToSwagger(tpe: Type, sfs: SwaggerFormats)(implicit
160-
st: ShowType): Option[ModelImpl] =
160+
st: ShowType): Option[ModelImpl] =
161161
try {
162162
val TypeRef(_, sym: Symbol, tpeArgs: List[Type]) = tpe
163163
val constructor = tpe.member(termNames.CONSTRUCTOR)
@@ -185,7 +185,7 @@ object TypeBuilder {
185185
}
186186

187187
private def paramSymToProp(sym: Symbol, tpeArgs: List[Type], sfs: SwaggerFormats)(pSym: Symbol)(
188-
implicit st: ShowType): (String, Property) = {
188+
implicit st: ShowType): (String, Property) = {
189189
val pType = pSym.typeSignature.substituteTypes(sym.asClass.typeParams, tpeArgs)
190190
val required = !(pSym.asTerm.isParamWithDefault || pType.isOption)
191191
val prop = typeToProperty(pType, sfs)
@@ -245,15 +245,15 @@ object TypeBuilder {
245245
object DataType {
246246

247247
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
252252
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
257257
case class ComplexDataType(name: String, qualifiedName: Option[String] = None) extends DataType
258258
case class EnumDataType(enums: Set[String]) extends DataType { val name = "string" }
259259

Diff for: swagger/src/test/scala/org/http4s/rho/swagger/TypeBuilderSuite.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ package object model {
7272
modelOfWithFormats(DefaultSwaggerFormats)
7373

7474
def modelOfWithFormats[T](
75-
formats: SwaggerFormats)(implicit t: TypeTag[T], st: ShowType): Set[Model] =
75+
formats: SwaggerFormats)(implicit t: TypeTag[T], st: ShowType): Set[Model] =
7676
TypeBuilder.collectModels(t.tpe, Set.empty, formats, typeOf[IO[_]])
7777
}
7878

0 commit comments

Comments
 (0)