jsontypedef/json-typedef-codegen

Support processing yaml schema?

Closed this issue · 1 comments

Hi,

In https://jsontypedef.com/docs/jtd-in-5-minutes/, it shows that you can write JSON Type Def in either JSON or YAML.

properties:
    name:
        type: string
    isAdmin:
        type: boolean

Does json-typedef-codegen support generating code from yaml schemas?

Not directly. You need to convert the YAML to JSON first. From the docs you link to:

Technically, only the JSON representation of a schema is valid. But writing schemas in YAML, and then converting them to JSON at the last minute, is a pretty common practice.