Can't use a parameter as the input to an expression
This fails to compile:
service PeopleService {
operation findPeople(
currentTime : Instant = now(),
@HttpHeader(name = "If-Modified-Since") ifModifiedSince : Instant = addDays(currentTime, -1)
):Person[]
}
Note that addDays(currentTime)
references a value from within the inputs. This should be valid
Here's a failing test, stashed from OperationSpec
:
it("can use other parameters as inputs to an expression") {
""" model Person {
name : Name inherits String
}
service PeopleService {
operation findPeople(
currentTime : Instant = now(),
@HttpHeader(name = "If-Modified-Since") ifModifiedSince : Instant = addDays(currentTime, -1)
):Person[]
}""".compiled()
}
Edited by Marty Pitt