An open API service indexing awesome lists of open source software.

https://github.com/aep/yema

the universal type generator
https://github.com/aep/yema

Last synced: 11 months ago
JSON representation

the universal type generator

Awesome Lists containing this project

README

          

YEMA - the interchangeable schema language
------------------------------------------

yema is an extremly simple and obvious schema definition.
this is currently used in apogy and its unclear if its going to be made useful for other purposes.

its only purpose is to generate type bindings for all programming languages,
it does intentionally NOT support constraints like jsonschema.
it also does not define any wire format, although you'd probably want json, msgpack, etc..

yema can be defined in yaml or json or whatever else.
here's a weird yaml to showcase all of it:

```yaml
firstName: string
middleName?: string
lastName: string
age: int32
favoriteNums?: [int]
phones: [string]
addresses: [{
street: string,
city: string,
zipCode: string
}]
favoriteObjects:
- color: string
shape?: int
settings:
notifications: bool
theme: string
limits?:
max: int64
```

you can use it as cli to generate types:

go install github.com/aep/yema/cmd/yema@latest

yema example.yaml -o cue
yema example.yaml -o jsonschema
yema example.yaml -o golang
yema example.yaml -o rust
yema example.yaml -o typescript