FHIR Chat · Throw error on unrecognized parameters · hapi

Stream: hapi

Topic: Throw error on unrecognized parameters


view this post on Zulip 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:

https://temp-snowstorm.ihtsdotools.org/fhir/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=ecl/%3C%3C362958002:%3C%3C363704007=%3C%3C80891009&filter=MRI&version=foo

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.

view this post on Zulip 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