Stream: conformance
Topic: value="" valid, or not?
Patrick Werner (May 13 2018 at 08:02):
I couldn't find it in the spec - is something like: xml <value value=""/>
valid or not?
According to the XML spec it would be valid, and i couldn't find a constraint which restricts this in FHIR.
If i validate such a structure against HAPI/VONK it fails to validate because of the empty value.
Michel Rutten (May 13 2018 at 08:09):
@Patrick Werner see this page:
http://hl7.org/fhir/formats.html
"This value attribute/property can never be empty. Either it is absent, or it is present with at least one character of non-whitespace content"
Patrick Werner (May 13 2018 at 08:47):
there it is! Thanks for pointing me to the right place in the spec
Michel Rutten (May 13 2018 at 11:34):
No prob. I remember looking into this when Ewout implemented the serializers in the .NET library.
Brian Postlethwaite (May 13 2018 at 12:04):
I thought that the parsers were happy with this, and the validator was where it was reported.
Michel Rutten (May 13 2018 at 16:33):
Yes, deserialization is (somewhat) forgiving, but serialization strictly follows this rule; empty values are never serialized to the output.
Stefan Lang (May 13 2018 at 16:43):
If people do it right, which they sometimes don't
Michel Rutten (May 13 2018 at 16:52):
Correct, but I was just referring to our own .NET API.
Patrick Werner (May 14 2018 at 13:56):
looking at the regex of String: \s*(\S|\s)*
Patrick Werner (May 14 2018 at 13:56):
which tells me i could have a empty value?
Michel Rutten (May 14 2018 at 13:57):
That is a horrible regex that should be removed or replaced.
Patrick Werner (May 14 2018 at 13:57):
i'll do a tracker item
Elliot Silver (May 14 2018 at 13:57):
I've filed a ballot comment on that.
Patrick Werner (May 14 2018 at 13:57):
ah perfekt.
Michel Rutten (May 14 2018 at 13:59):
Note: literally implementing such a regex in your server will open up a vector for a DOS attack...
https://en.wikipedia.org/wiki/ReDoS
Elliot Silver (May 14 2018 at 14:00):
Last updated: Apr 12 2022 at 19:14 UTC