Stream: hapi
Topic: Throw error on unrecognized parameters
Peter Williams (Jun 30 2020 at 13:32):
HAPI is very forgiving of unrecognized parameters by default. For example in a $expand operation I can add in a version parameter, which is not part of the specification, and it is just ignored:
It should be system-version. Similarly we have issues with people calling operations with systemVersion when they should be using version or visa-versa.
I'd like to throw an error to let people know when they're using the wrong parameters. Is there a simple way to do this in Java HAPI please? I didn't find anything in the docs.
Michael Lawley (Jul 04 2020 at 04:33):
If you declare version
as a parameter in your $expand
provider method, you can then check if a value has been provided and return an appropriate error.
Last updated: Apr 12 2022 at 19:14 UTC