Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kitagry/gostjs
[WIP] Create Json Schema from Go struct.
https://github.com/kitagry/gostjs
Last synced: 13 days ago
JSON representation
[WIP] Create Json Schema from Go struct.
- Host: GitHub
- URL: https://github.com/kitagry/gostjs
- Owner: kitagry
- Created: 2020-08-11T13:34:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-13T07:57:51.000Z (over 4 years ago)
- Last Synced: 2024-04-17T19:28:05.510Z (7 months ago)
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## gostjs
Create JSON Schema from golang struct.
### Installation
```
go get github.com/kitagry/gostjs
```### Usage
```
Usage of gostjs:
-output string
output file name
-src-path string
go build src path
-tag string
tag name (default "json")
``````
$ gostjs github.com/kitagry/gostjs/test.Test | gojq
{
"$schema": "http://json-schema.org/schema#",
"description": "Test's docs\n",
"properties": {
"": {
"properties": {
"Name": {
"type": "string"
}
},
"type": "object"
},
"Child2": {
"properties": {
"Name": {
"type": "string"
}
},
"type": "object"
},
"Interface": {
"type": ""
},
"array": {
"contains": {
"type": "string"
},
"type": "array"
},
"child": {
"properties": {
"Name": {
"type": "string"
}
},
"type": "object"
},
"id": {
"type": "number"
},
"map": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"name": {
"description": "Name is name\n",
"type": "string"
}
},
"type": "object"
}
```### License
MIT