serverless-step-functions icon indicating copy to clipboard operation
serverless-step-functions copied to clipboard

JSON support

Open bjfletcher opened this issue 7 years ago • 2 comments

As of Serverless v1.15.0, serverless.json is supported as well as serverless.(yml|yaml) (see https://github.com/serverless/serverless/releases)

This excellent plugin doesn't yet support JSON.

bjfletcher avatar Jul 13 '17 09:07 bjfletcher

So... While the filename is required to be serverless.yml, the format itself can be JSON. YAML 1.2 is actually a superset of JSON, so any correctly implemented YAML parser should also be able to parse JSON. I checked, and the parser that Serverless uses (js-yaml) does parse correctly.

It also means you can do really fun stuff with this plugin, like inject a JSON state machine definition file into a YAML serverless.yml.

noahw3 avatar Jan 31 '19 03:01 noahw3

It's true that the format itself can be JSON, but it's kindof a pain creating a file with the yml extension but JSON content. It mucks with the syntax highlight on many editors, and generally just feels dirty to have an extension that doesn't match the content.

patrick-hampton-avalara avatar Sep 24 '19 22:09 patrick-hampton-avalara