modulepackage
0.7.0
Repository: https://github.com/golang-malawi/geneveev.git
Documentation: pkg.go.dev
# README
geneveev
A command-line tool to generate object schemas from Go structs.
Currently it supports generating
- Yup and Zod schemas that use go-playground/validator tags.
- Dart classes via the embedded go-to-dart functionality
Useful for setting up validation for front-end development and for creating Data Transfer objects for Go APIs that have flutter clients
NOTE: still in very early development
Installation
go install github.com/golang-malawi/geneveev@latest
Usage
Generating Yup Schemas
$ geneveev generate yup -d /path/to/package/with/validated/structs/ --output-dir ./yup-schemas
Generating Zod Schemas
$ geneveev generate zod -d /path/to/package/with/validated/structs/ --output-dir ./zod-schemas
Generating Dart classes
$ geneveev generate dart -d /path/to/package/with/validated/structs/ --output-dir ./dart-classes
Example
Generate from this
To this:
Features
Yup Schema
- Generates basic yup object schemas from basic Go structs
Zod Schema
- Generates basic zod object schemas from basic Go structs
go-to-dart
The Go-to-dart implementation helps you convert Go structs to Dart classes that can be used with json_serializable.
- Supports only structs in the same package (no generics or embedded structs yet)
- Supports primitives, slices, maps, and pointers
- Support some other arbitrary types such as
time.Time
andmo.Option
(easy to extend!) - Support for
json
tags
Contributors
- Zikani Nyirenda Mwase - Maintainer
LICENSE
MIT LICENSE
# Packages
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author