Sign in

So you need to convert a .yaml file to a flattened JSON map in Java? I won’t ask why.

Requirements/What I am using:

  • IntelliJ
  • Gradle
  • Java 11

This is how to convert a YAML file to a flattened JSON map.

Here is a random example I grabbed from GitHub (https://raw.githubusercontent.com/Praqma/helmsman/master/examples/example.yaml taken from Praqma/helmsman: Helm Charts as Code (github.com))

# version: v3.4.0 # context defines the context of this Desired State File. # It is used to allow Helmsman identify which releases are managed by which DSF. # Therefore, it is important that each DSF uses a unique context. context: test-infra…

Dylan Souvage

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store