jsontypedef / json-typedef-codegen

A CLI tool that generates code from JSON Typedef schemas
https://jsontypedef.com/docs/tools/jtd-codegen
MIT License
160 stars 31 forks source link

cant generate types from this jsonld schema #62

Closed albjeremias closed 1 year ago

albjeremias commented 1 year ago

i clone this repo: https://github.com/redaktor/ActivityPubSchema

and did: jtd-codegen type/Accept.json --typescript-out ts/

and I got

Error: Failed to parse input as JSON

Caused by:
unknown field `$id`, expected one of `definitions`, `nullable`, `ref`, `type`, `enum`, `elements`, `properties`, `optionalProperties`, `additionalProperties`, `values`, `discriminator`, `mapping`, `metadata` at line 2 column 8
ucarion commented 1 year ago

These are JSON Schema documents, not JSON Typedef. I'm afraid jtd-codegen cannot help you here; jtd-codegen only can generate code from JSON Typedef documents.

albjeremias commented 1 year ago

damn, and is it possible to convert schema do typedef? or maybe i can do it from the schema...