-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #5778: correct API with JSON parameters for directives creation&up... #702
Conversation
… creation&update
private[this] def extractJsonDirectiveParam (json: JValue ): Box[Map[String,Seq[String]]] = { | ||
json \\ "parameters" match { | ||
case x@JObject(_) => parseSectionVal(x).map(SectionVal.toMapVariables(_)) | ||
case _ => Failure(s"Not a good value for parameter ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you tell which one a bad value for parameter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Why is this change only in branch 3.0 ? from what I understood of the ticket, it is a bug existing in current version of the API, isn't it ? |
@@ -569,9 +574,11 @@ case class RestExtractorService ( | |||
longDescription <- extractOneValueJson(json, "longDescription")() | |||
enabled <- extractOneValueJson(json, "enabled")( convertToBoolean) | |||
priority <- extractOneValueJson(json, "priority")(convertToInt) | |||
parameters <- extractOneValueJson(json, "parameters")(convertToDirectiveParam) | |||
parameters <- extractJsonDirectiveParam(json) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if we try to create a directive with no parameter, because the technique isn't expecting any ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, it should be possible to do so.
That PR is not targetting the correct branch. Closing it. |
New PR: #707 |
No description provided.