Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dave - automatically returns a 400 when all required params are not f…
…ound
- Loading branch information
david denton
committed
Mar 22, 2015
1 parent
7675e83
commit c9afc90
Showing
5 changed files
with
87 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/main/scala/io/github/daviddenton/fintrospect/ModuleRoute.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package io.github.daviddenton.fintrospect | ||
|
||
import com.twitter.finagle.http.path.Path | ||
import io.github.daviddenton.fintrospect.parameters.Requirement._ | ||
import io.github.daviddenton.fintrospect.parameters.{Parameter, PathParameter, Requirement} | ||
|
||
class ModuleRoute(val description: Description, val on: On, val basePath: Path, pathParams: Seq[PathParameter[_]]) { | ||
val allParams: List[(Requirement, Parameter[_])] = description.optional.map(Requirement.Optional -> _) ++ | ||
(description.required ++ pathParams).map(Requirement.Mandatory -> _) | ||
val allParams: List[(Requirement, Parameter[_])] = description.optional.map(Optional -> _) ++ | ||
(description.required ++ pathParams).map(Mandatory -> _) | ||
|
||
override def toString: String = (on.completeRoutePath(basePath).toString :: pathParams.map(_.toString()).toList).mkString("/") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters