Home Applications yaml-utils

yaml-utils

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
4.5
0 reviews
0
Awards
632
Views
716
IPM installs
0
0
Details
Releases
Reviews
Issues
Dependants  (5)
Simple ObjectScript YAML-to-JSON converter

What's new in this version

fix bug when there's a leading indent for the whole file

Repo-GitHub
Quality Gate Status

YAML Utils

Usage

Very simple ObjectScript YAML-to-JSON converter:

set obj = ##class(YAML.Utils).FileToJSON("C:\temp\test.yaml", .sc)
zwrite obj

Additional StringToJSON() and StreamToJSON() methods do exactly what you’d expect them to (I hope!)

Note: I first put the script in place so I could quickly test https://github.com/lscalese/OpenAPI-Client-Gen on my own YAML Swagger def in the context of the Interoperability contest, so that’s really the amount of testing it’s seen. Those 5k lines of YAML aren’t too bad to get started, but happy to accept PRs to make it more robust for other real-world YAML.

Installation

Easy installation using ZPM (pending approval):

USER> zpm
zpm: USER> install yaml-utils

[yaml-utils] Reload START
[yaml-utils] Reload SUCCESS
[yaml-utils] Module object refreshed.
[yaml-utils] Validate START
[yaml-utils] Validate SUCCESS
[yaml-utils] Compile START
[yaml-utils] Compile SUCCESS
[yaml-utils] Activate START
[yaml-utils] Configure START
[yaml-utils] Configure SUCCESS
[yaml-utils] Activate SUCCESS

Otherwise just load the sole YAML.Utils class and start converting.

Made with
Install
zpm install yaml-utils download archive
Version
0.1.401 Mar, 2024
ObjectScript quality test
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for Health
First published
19 Nov, 2020
Last checked by moderator
25 Aug, 2024Works