FHIR Chat · FHIR resource serialization · hapi

Stream: hapi

Topic: FHIR resource serialization


view this post on Zulip Mark Discenza (Oct 12 2020 at 17:40):

When the HAPI server serializes resources in response to a read or search, is there a way to influence the order of resource attributes in the json that gets returned?

view this post on Zulip Grahame Grieve (Oct 12 2020 at 19:21):

in principle, it cannot matter. Or at least, if your implementation needs it to matter, you need to revise your implementation

view this post on Zulip Mark Discenza (Oct 12 2020 at 19:29):

I agree, it does not matter for json consumed by a software module. We are interested in attribute reordering for human readability for testing purposes. For example, it would be nice to reorder attributes in the same order specified in the IG we are using. That's the motivator here.

view this post on Zulip Grahame Grieve (Oct 12 2020 at 20:36):

ah. been there, done that. You need a json comparison tool that can canonical json before comparison

view this post on Zulip Grahame Grieve (Oct 12 2020 at 20:36):

there's one in HAPI if it's of interest

view this post on Zulip Mark Discenza (Oct 12 2020 at 22:00):

yeah, I'd be interested in taking a look at that. Do you know that name of the tool, or perhaps can tell me where in HAPI-land to look for it? Thx Grahame!

view this post on Zulip Grahame Grieve (Oct 12 2020 at 22:23):

compareJson in org.hl7.fhir.r5.test.utils.TestingUtilities


Last updated: Apr 12 2022 at 19:14 UTC