@@ -32,7 +32,7 @@ object OpenAPIGenSpec extends ZIOSpecDefault {
32
32
private val simpleEndpoint =
33
33
Endpoint (
34
34
(GET / " static" / int(" id" ) / uuid(" uuid" ) ?? Doc .p(" user id" ) / string(" name" )) ?? Doc .p(" get path" ),
35
- )
35
+ )
36
36
.in[SimpleInputBody ](Doc .p(" input body" ))
37
37
.out[SimpleOutputBody ](Doc .p(" output body" ))
38
38
.outError[NotFoundError ](Status .NotFound , Doc .p(" not found" ))
@@ -49,11 +49,10 @@ object OpenAPIGenSpec extends ZIOSpecDefault {
49
49
.inCodec(
50
50
(HttpCodec .content[OtherSimpleInputBody ] ?? Doc .p(" other input" ) | HttpCodec
51
51
.content[SimpleInputBody ] ?? Doc .p(" simple input" )) ?? Doc .p(" takes either of the two input bodies" ),
52
- )
52
+ )
53
53
.out[SimpleOutputBody ]
54
54
.outError[NotFoundError ](Status .NotFound )
55
55
56
-
57
56
def minify (str : String ): String =
58
57
Json .encoder.encodeJson(Json .decoder.decodeJson(str).toOption.get, None ).toString
59
58
override def spec : Spec [TestEnvironment with Scope , Any ] =
@@ -794,21 +793,21 @@ object OpenAPIGenSpec extends ZIOSpecDefault {
794
793
|}""" .stripMargin
795
794
assertTrue(json == minify(expectedJson))
796
795
},
797
- test(" with query parameter, alternative input, alternative output and examples" ){
796
+ test(" with query parameter, alternative input, alternative output and examples" ) {
798
797
val endpoint =
799
798
Endpoint (GET / " static" )
800
799
.inCodec(
801
800
HttpCodec
802
801
.content[OtherSimpleInputBody ] ?? Doc .p(" other input" ) |
803
802
HttpCodec
804
- .content[SimpleInputBody ] ?? Doc .p(" simple input" )
803
+ .content[SimpleInputBody ] ?? Doc .p(" simple input" ),
805
804
)
806
805
.query(QueryCodec .paramStr(" query" ))
807
806
.outCodec(
808
807
HttpCodec
809
808
.content[SimpleOutputBody ] ?? Doc .p(" simple output" ) |
810
809
HttpCodec
811
- .content[NotFoundError ] ?? Doc .p(" not found" )
810
+ .content[NotFoundError ] ?? Doc .p(" not found" ),
812
811
)
813
812
814
813
val generated = OpenAPIGen .fromEndpoints(" Simple Endpoint" , " 1.0" , endpoint)
@@ -1104,7 +1103,7 @@ object OpenAPIGenSpec extends ZIOSpecDefault {
1104
1103
" 1.0" ,
1105
1104
simpleEndpoint,
1106
1105
queryParamEndpoint,
1107
- alternativeInputEndpoint
1106
+ alternativeInputEndpoint,
1108
1107
)
1109
1108
val json = generated.toJson
1110
1109
val expected =
@@ -1409,7 +1408,7 @@ object OpenAPIGenSpec extends ZIOSpecDefault {
1409
1408
| }
1410
1409
|}""" .stripMargin
1411
1410
assertTrue(json == minify(expected))
1412
- }
1411
+ },
1413
1412
)
1414
1413
1415
1414
}
0 commit comments