Stream: committers
Topic: Build error: cvc-complex-type.2.4.a
Gino Canessa (Apr 21 2020 at 15:32):
Hi everyone, I had a strange build error that took a while to track down, so I thought I'd post for posterity.
In adding a new resource, the examples were getting:
[java] ERROR @ C:\git\fhir\publish\subscriptionstatus-example.xml (line 2, col23): subscriptionstatus-example:: C:\git\fhir\publish\subscriptionstatus-example.xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'id'. One of '{"http://hl7.org/fhir":extension}' is expected. (src = InstanceValidator)
I eventually figured out this was caused by a code list in another resource (Subscription.status), which had the same name and was processed first. The validator was apparently trying to parse the SubscriptionStatus resource instances as a value set.
I'm not sure what the error would look like in reverse (e.g., if the resource came before the value set), but I imagine it would be similar.
Cheers,
-Gino
Eric Haas (Apr 21 2020 at 16:31):
bottom line is don't name a resource the same as an resource + element?
Gino Canessa (Apr 21 2020 at 16:33):
I think it was the valueset generated from the code list. The element is still Subscription.status
, but changing the binding on the code list from SubscriptionStatus
to SubscriptionState
let the build pass.
Last updated: Apr 12 2022 at 19:14 UTC