* WIP enums
* WIP moar enums
* add a helper function for extracting enum from route pattern
* add enum schemas to services
* review and improve service names
* convert some more services with enums
* review and improve service names
* fix issue/pull request detail
* allow serviceData to override cacheSeconds with a longer value
* prevent [endpoint] json cacheSeconds property exceeding service default
* allow ShieldsRuntimeError to specify a cacheSeconds property
By default error responses use the cacheLength of
the service class throwing the error.
This allows error to tell the handling layer the maxAge
that should be set on the error badge response.
* add customExceptions param
This
1. allows us to specify custom properties to pass to the exception
constructor if we throw any of the standard got errors
e.g: `ETIMEDOUT`, `ECONNRESET`, etc
2. uses a custom `cacheSeconds` property (if set on the exception)
to set the response maxAge
* customExceptions --> systemErrors
* errorMessages --> httpErrors
This looks like a case of confusing `Joi.allow()` with `Joi.valid()`.
`Joi.valid(...['A', 'A-']).validate('-')` throws an error but `Joi.allow(...['A', 'A-']).validate('-')` allows it through.
Closes#4033
It’s hard to understand how #3813 is persisting. The schema should reject keys not in the object… it’s very puzzling.
This replaces the code used to get the color with a function call that throws an explicit error when the key is missing. It should at least make it clear what the key value is when this fails in the future.