File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
src/main/scala/com/wordnik/swagger/codegen Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package com.wordnik.swagger.codegen.spec
18
18
19
19
import com .wordnik .swagger .codegen .util .{CoreUtils , ApiExtractor , ResourceExtractor }
20
20
import com .wordnik .swagger .codegen .PathUtil
21
+ import com .wordnik .swagger .model ._
21
22
22
23
import scala .collection .JavaConversions ._
23
24
@@ -28,9 +29,19 @@ object Validator extends PathUtil {
28
29
}
29
30
val host = args(0 )
30
31
val authorization = {
31
- // if (args.length > 1) Some("?api_key=" + args(1))
32
- // else
33
- None
32
+ Option (System .getProperty(" header" )) match {
33
+ case Some (e) => {
34
+ // this is ugly and will be replaced with proper arg parsing like in ScalaAsyncClientGenerator soon
35
+ val authInfo = e.split(" :" )
36
+ Some (ApiKeyValue (authInfo(0 ), " header" , authInfo(1 )))
37
+ }
38
+ case _ => {
39
+ if (args.length > 1 ) {
40
+ Some (ApiKeyValue (" api_key" , " query" , args(1 )))
41
+ }
42
+ else None
43
+ }
44
+ }
34
45
}
35
46
36
47
val outputFilename = {
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ trait RemoteUrl {
27
27
}
28
28
case None => new URL (url).openConnection()
29
29
}
30
- println(conn)
31
30
is = conn.getInputStream()
32
31
Source .fromInputStream(is).mkString
33
32
}
You can’t perform that action at this time.
0 commit comments