Has anyone ever tried to build an XML adapter for ...
# http4k
a
Has anyone ever tried to build an XML adapter for moshi?
http4k-format-moshi-yaml
, works by using snakyeaml to convert to an object graph, and then let moshi handle the mapping. The beauty of it is that you can then combine kotshi for fully non-reflective YAML mapping. But I imagine since XML is such a wild-west, the same sort of adapter wouldn't be feasible. Or at least, more involved, since snakeyaml already did the heavy lifting of converting the YAMl to an object graph. The builtin java XML parser used by http4k-connect does no such thing.
d
XML is a nightmare because noone can agree how to model lists properly.
I actually almost generated an entire aws SDK on connect style and the thing that tripped me up was the S3 XML format. I gave up in disgust! 🤣
a
Yeah, I was trying to get out of hand-mapping an EC2 DescribeNetworkInterfacesResponse. It's hard to believe connect has gone this long without an EC2 SDK!
I'm going to have a lot of PRs once I'm done this new infra upgrade: • New ECS Metadata service: my containers need to know their own private ips for p2p (although http-over-redis would have worked too) • route53 ChangeResourceRecordSet not supporting set identifiers (so my poor man's load balancers can register themselves to multivalue records, since Cloud Map Service registries only work for private ips) • New SecretsManagerRotationEventAdapter for lambda • New EC2 SDK (so I can get the public IP's from the ENI ids in the the ecs task change event)
All of this so I can load balance websocket servers without paying an arm and leg for ALBs, and without having to load-balance server-side. One single DNS that my load balancers balance themselves.
🔥 1
d
👍🌟