{"repo":"eventuallyconsultant/codegenr","free":true,"listed":false,"github":"https://github.com/eventuallyconsultant/codegenr","clone":"git clone https://github.com/eventuallyconsultant/codegenr.git","description":"Fast handlebars templates based code generator, ingesting swagger/openapi and other json/yaml documents with $refs, or graphql schema, outputs whatever you template","language":"Rust","stars":32,"topics":["codegen","rust","handlebars","codegenerator","openapi","swagger","api-first","graphql","graphql-schema","rhai"],"license":"GPL-3.0","category":"api-integrations-sdks","readme_excerpt":"CodeGenR Installation Install Rust : https://www.rust-lang.org/tools/install. And then install codegenr or install the development version Documentation codegenr documentation on docs.rs Codegen Steps Here is a simple folders/files Tree we're gonna use in example codegenr.toml To generate your files, you need to define these parameters : - [section name] : A unique name representing each section - source : The file.yaml with the data you want to use for the generation - templates : the folders containing handlebar templates ( .hbs ) you're using. Only one file in those folders must not be prefixed by and then is considered as the main template. The other ones are prefixed like partial.hbs are considered partial templates. - output : The root folder where the files will be generated. All files output path write will be computed from this root. - custom helpers : A place you can put .rhai file, each file is loaded as a custom helper, usable from the .hbs templates - intermediate : (Optional) if set, codegenr will output intermediate files for debug purpose - global parameters : (Optional) Some values you want to use with the global parameter helper. Here is an example of a section in the codegenr.toml . Load The load step will read the source file and turn it to json - if it's a json file, it's quite easy - if it's a yaml file, it's not that hard - if it's a graphql sdl file, it's lead to some structure changes If you look closely to example below, you can see that $ref: \"#/com","default_branch":null,"files":null,"tree":[],"storefront":"/r/eventuallyconsultant","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/eventuallyconsultant/codegenr/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}