All Projects → pacifio → json2dart

pacifio / json2dart

Licence: MIT license
A CLI tool to help generate dart classes from json returned from API

Programming Languages

dart
5743 projects
shell
77523 projects

Projects that are alternatives of or similar to json2dart

Weld
High-performance runtime for data analytics applications
Stars: ✭ 2,709 (+7028.95%)
Mutual labels:  code-generation
codespawn
Code generator written in Rust
Stars: ✭ 34 (-10.53%)
Mutual labels:  code-generation
FunStripe
An F# library to connect to the Stripe API, including code generators to update the model and requests.
Stars: ✭ 35 (-7.89%)
Mutual labels:  code-generation
Moshix
Moshi Extensions
Stars: ✭ 243 (+539.47%)
Mutual labels:  code-generation
sisyphus-js
Sisyphus customized protobuf and gRPC runtime and code generator for JavaScript/TypeScript
Stars: ✭ 19 (-50%)
Mutual labels:  code-generation
codemagic-docs
Here you’ll find some essential information for setting up CI/CD for your mobile apps with Codemagic.
Stars: ✭ 63 (+65.79%)
Mutual labels:  flutter-tool
Codealchemist
Semantics-aware Code Generation for Finding JS engine Vulnerabilities
Stars: ✭ 204 (+436.84%)
Mutual labels:  code-generation
linnea
Linnea is an experimental tool for the automatic generation of optimized code for linear algebra problems.
Stars: ✭ 60 (+57.89%)
Mutual labels:  code-generation
pony-capnp
Cap’n Proto plugin for generating serializable Pony classes. 🐴 - 🎩'n 🅿️
Stars: ✭ 19 (-50%)
Mutual labels:  code-generation
evon
Fast and versatile event dispatcher code generator for Golang
Stars: ✭ 15 (-60.53%)
Mutual labels:  code-generation
Kotlinpoet
A Kotlin API for generating .kt source files.
Stars: ✭ 3,004 (+7805.26%)
Mutual labels:  code-generation
opensbli
A framework for the automated derivation and parallel execution of finite difference solvers on a range of computer architectures.
Stars: ✭ 56 (+47.37%)
Mutual labels:  code-generation
gg
General Golang Code Generator
Stars: ✭ 88 (+131.58%)
Mutual labels:  code-generation
Amplication
Amplication is an open‑source development tool. It helps you develop quality Node.js applications without spending time on repetitive coding tasks.
Stars: ✭ 3,630 (+9452.63%)
Mutual labels:  code-generation
brian2cuda
A brian2 extension to simulate spiking neural networks on GPUs
Stars: ✭ 46 (+21.05%)
Mutual labels:  code-generation
Curryhoward
Automatic code generation for Scala functions and expressions via the Curry-Howard isomorphism
Stars: ✭ 229 (+502.63%)
Mutual labels:  code-generation
go-zero
A cloud-native Go microservices framework with cli tool for productivity.
Stars: ✭ 23,294 (+61200%)
Mutual labels:  code-generation
flatorize
Generate fast implementations of mathematical expressions. Inclues a linear algebra library.
Stars: ✭ 18 (-52.63%)
Mutual labels:  code-generation
Templates
CodeSmith Generator Templates
Stars: ✭ 52 (+36.84%)
Mutual labels:  code-generation
scalagen
WIP - Scalameta powered code generation
Stars: ✭ 38 (+0%)
Mutual labels:  code-generation

Json 2 Dart Command line utility

Important note

There is already a package called json2dart so this package will be called json2dartc !

This project was made using javiercbk's json_to_dart package ! This CLI was made to directly convert JSON stuctures into Dart classes . I personally don't like build runners and json serializers so I made this for my workflow . Feel free to open issues and submit PRs .

How to use

Install this via pub

pub global activate json2dartc

Example

json2dartc -u https://reqres.in/api/users -m get -e data -n Example

Null safety

To turn on null safe code generation , add the flag --null-safe , Example :

json2dartc -u https://reqres.in/api/users -m get -n Example --null-safe

Options

-u, --api        API Endpoint required to grab the json from
-e, --entry      Entry point for json data structure , e.g data.data will get the nested data array/object from API response
-n, --name       Name of your data class
                 (defaults to "AutoGenerated")
-h, --headers    Headers for your API endpoint
-m, --method     Method for http request , defaults to GET
                 (defaults to "GET")
Option required default example note
-u true required field https://reqres.in/api/users
-e false '' data it's used for special access in json data , e.g data.data will access nested data object within data object
-n false 'AutoGenerated' Example
-h false {} access-token=01234,foo=bar
-m false GET GET/POST

Upcoming plans

  • Null safety support
  • Tool itself written with null safety
  • Private memmbers option
  • Option to load json from a file
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].