GenSON icon indicating copy to clipboard operation
GenSON copied to clipboard

YAML Support

Open DylanYoung opened this issue 5 years ago • 5 comments

Do we have YAMl support? Do you want it? I'd be happy to implement, at least on the input side.

DylanYoung avatar Oct 08 '19 14:10 DylanYoung

Thanks for the suggestion! Sorry for the slow response. I was on vacation, and then I moved.

I hadn't intended to build this in since it would require adding a dependency, but I suppose that shouldn't be a big deal. As it is, you can easily wrap the output in YAML:

yaml.dumps(builder.to_schema())

But I'm assuming you want to use it with the executable, in which case YAML would have to be built in. If that's the case, feel free to submit a PR and I'll take a look. I'd also happily take suggestions for other formats people might want (xml? ini?).

wolverdude avatar Dec 09 '19 06:12 wolverdude

@wolverdude

Actually, I think that's fine for my use case. I was actually looking for yaml input (to generate a json schema for our yaml changelog to work with vs code), but I see now that I can just parse the yaml into python dicts, feed GenSON that way, and output however I want.

Works for me! You can close this if there's no other interest. I could do a PR to support Yaml if you're interested. It wouldn't be too much work and I do appreciate your helpful response :)

Thanks!

DylanYoung avatar Dec 22 '19 02:12 DylanYoung

I'll leave the Issue up for a while to see if there's more interest before closing. Anyone who wants to see other serialization formats besides JSON supported natively, please mention here.

wolverdude avatar Dec 23 '19 04:12 wolverdude

I almost never use JSON but I use YAML a lot and it would be extreamly useful to have native support for YAML and avoid the intermediary conversion. Please make it happen!

ssbarnea avatar Jan 12 '20 12:01 ssbarnea

Sweet. I'm in rough living situation right now, but I'll come back to this after I'm situated if noone picks it up before then :)

On Sun., Jan. 12, 2020, 8:28 a.m. Sorin Sbarnea, [email protected] wrote:

I almost never use JSON but I use YAML a lot and it would be extreamly useful to have native support for YAML and avoid the intermediary conversion. Please make it happen!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wolverdude/GenSON/issues/39?email_source=notifications&email_token=ABMG3FA5ETQQ6VHJCIXEPBLQ5MEGDA5CNFSM4I6S2RC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIWYYYA#issuecomment-573410400, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMG3FGW6FKYK2CNL7GULALQ5MEGDANCNFSM4I6S2RCQ .

DylanYoung avatar Jan 12 '20 18:01 DylanYoung