Closed lroggendorff closed 7 years ago
@JoshMock Funny you should ask... I wondered the same thing, and even started writing a test, and then upon getting an Invalid path
error from Hoek decided to look it up:
It is important to be aware that only the last named parameter in a path can be optional.
Go fig. Now, if someone wants to adds support for multi-segment parameters... that'd be fun.
perfect... thanks!
Hapi supports optional parameters in a route's path, designated by a
?
at the end of the parameter name.The Swagger 2.0 spec does not allow optional path parameters:
This change allows for a valid Swagger 2.0 file to be generated from routes with optional path parameters by duplicating such routes and adjusting the parameter definitions to match.