Skip to content

Commit

Permalink
docs: fix spelling & typo
Browse files Browse the repository at this point in the history
Signed-off-by: David Bernard <[email protected]>
  • Loading branch information
davidB committed May 24, 2024
1 parent a4f2d7a commit 40028d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Goals: generate rust code for cdevents from jsonschema provided as part of cdeve

- The generator take read jsonschema as json apply them to a set of templates
- The generator is very basic (no json schema semantic, no `$ref` resolution) like [eventuallyconsultant/codegenr: Fast handlebars templates based code generator, ingesting swagger/openapi and other json/yaml documents with $refs, or graphql schema, outputs whatever you template](https://github.com/eventuallyconsultant/codegenr/)
- The generator is currently used to generated Subjects
- The generator is currently used to generate Subjects

## Why not use a jsonschema to rust generator?

- I tried some and they failed (no error), maybe too early, not support for the version of jsonschema used by cdevents (often they support jsonschema draft-4)
- The json schema (v0.3) are not connected, so lot of duplication (context,...), so classical generators will create as many Context type as Event type,... Our implementation only part of the schema is extracted to generate what is different aka the `content` of subjects.
- I tried some and they failed (no error), maybe too early, or do not support the version of jsonschema used by cdevents (often they support jsonschema draft-4)
- The jsonschemas (v0.3) are not connected (a set of independent schemas), so a lot of duplication (context,...), so classical generators will create as many Context types as Event types,... In our implementation, only parts of the schema are extracted to generate what is different aka the `content` of subjects.

## Run

To generate the `subjects` into sibling crate `cdevents/src/generated` from content of `cdevents-specs/spec-v0.4/schemas`, from root workspace
To generate the `subjects` into sibling crate `cdevents/src/generated` from the content of `cdevents-specs/spec-v0.4/schemas`, from the root workspace

```sh
cargo run -p generator -- --help
Expand Down

0 comments on commit 40028d2

Please sign in to comment.