Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Fair point - source generators can run arbitrary code so yes, they can read a json file and then spit out something else in response. If you want to translate the json schema into the equivalent C# you'll need to write a small amount of code to deserialize the json into a JObject tree, walk it, and emit c# code. I do something similar in my Textrude code-generation/templating project except I'm translating the tree into an equivalent Scriban object tree. The relevant source code is here. All that said, this is a fairly specialised and common task - I can't believe there's not a command line tool to do this already.
Related posts
- Textrude - a template-based code/text-generation tool. Easy transformation of JSON/YAML/CSV models into code/text using Scriban templates.
- General-purpose code-generation tool, with support for data sources like yaml/csv/etc and a template language
- Show HN: Jeeves – A Pythonic Alternative to GNU Make
- A Python powered task management and automation tool
- Self-documenting task runner, define tasks in the README