smart-on-fhir / client-py

Python SMART on FHIR client
http://docs.smarthealthit.org
Other
574 stars 209 forks source link

Cannonical types being parsed as the underlying object rather than string URI #173

Closed dogversioning closed 3 weeks ago

dogversioning commented 3 weeks ago

Fields like the description field in a rest resource operation are specified as being cannonical references, but it looks like fhirclient is parsing them expecting the underlying object, resulting in errors like this:

  rest.0:
    operation.0:
      definition:
        Wrong type <class 'str'> for property "definition" on <class 'fhirclient.models.capabilitystatement.CapabilityStatementRestResourceOperation'>, expecting <class 'dict'>

We should, at a bare minimum, allow the string URI to be correctly parsed in this field. If possible, we might want to try looking the reference up, and building out the appropriate model as a result?

It may be worth looking back at the delta between 4.0.0 and 4.0.1, since this seems to only happen on the latest rev of v4.

Observed against https://r4.smarthealthit.org/metadata

mikix commented 3 weeks ago

This seems like it was an odd misconfiguration - Matt and I can't reproduce with fresh environments.