Skip to content

Improve BaseFhirJsonDeserializer seeking for resourceType #3295

@andrzejskowronski

Description

@andrzejskowronski

We need to know resourceType to create a mapping as that will determine behavior for each property.
Right now we do it via seeking for it, the 'rewinding' back, but that will break in network streamed scenarios.
Also worst case scenario, we will get Bundle with a lot of entries, but resourceType appears at the very end of a Bundle, we will read whole resource, then rewind back, then read it again.

Might be a nice improvement to pre-read the properties into a (propertyName, JsonElement) pairs until we encounter the resourceType, then process those, then continue reading the json.

Hopefully a lot of logic could be left as is by wrapping Utf8JsonReader into an API compatible ref struct that will first read over cache, then over remaining data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions