Skip to content

Commit 9997f8e

Browse files
committed
Fixes wrong schema.ID
1 parent 71855d0 commit 9997f8e

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

cmd/jsonschema/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const jsonschemaFile = "schema.json"
1212
//go:generate sh -c "cd ../../ && go run cmd/jsonschema/main.go"
1313
func main() {
1414
schema := jsonschema.Reflect(&model.Config{})
15-
schema.ID = "https://github.com/DanielLiu1123/gencoder/tree/main/pkg/model/table.go"
15+
schema.ID = "https://github.com/DanielLiu1123/gencoder/blob/main/pkg/model/config.go"
1616

1717
err := util.WriteFile(jsonschemaFile, []byte(util.ToJson(schema)))
1818
if err != nil {

pkg/cmd/generate/generate.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,15 @@ func NewCmdGenerate(globalOptions *model.GlobalOptions) *cobra.Command {
3535
Use: "generate",
3636
Short: "Generate code from database configuration",
3737
Aliases: []string{"gen", "g"},
38-
Example: ` # Generate code from default config file (gencoder.yaml)
39-
$ gencoder generate
40-
41-
# Generate code from a specific config file
42-
$ gencoder generate -f myconfig.yaml
43-
44-
# Generate code with custom import helper JavaScript file
45-
$ gencoder generate -f myconfig.yaml --import-helper helpers.js
46-
47-
# Generate boilerplate code from URL with custom properties
48-
$ gencoder generate --templates "https://github.com/user/template-project" --properties="package=com.example,author=Freeman"
49-
`,
38+
Example: `
39+
# Generate code from config file (default: gencoder.yaml), config json schema: https://raw.githubusercontent.com/DanielLiu1123/gencoder/refs/heads/main/schema.json
40+
$ gencoder generate -f gencoder.yaml
41+
42+
# Generate code from a template project with custom properties
43+
$ gencoder generate --templates "https://github.com/user/template-project" --properties "package=com.example,author=Freeman" --include-non-tpl
44+
45+
# Generate code using custom helpers, build-in helpers: https://github.com/DanielLiu1123/gencoder/blob/main/pkg/jsruntime/helper.js
46+
$ gencoder generate --import-helper helpers.js`,
5047
PreRun: func(cmd *cobra.Command, args []string) {
5148
validateArgs(args)
5249
opt.Properties = parseProperties(props)

pkg/cmd/init/init.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ func NewCmdInit(globalOptions *model.GlobalOptions) *cobra.Command {
2020
c := &cobra.Command{
2121
Use: "init",
2222
Short: "Init basic configuration for gencoder",
23-
Example: ` # Init basic configuration for gencoder
23+
Example: `
24+
# Init basic configuration for gencoder
2425
$ gencoder init
2526
2627
# Init basic configuration in a specific directory

pkg/cmd/introspect/introspect.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ func NewCmdIntrospect(globalOptions *model.GlobalOptions) *cobra.Command {
2222
Use: "introspect",
2323
Short: "introspect command is used to output the table metadata information for the given configuration.",
2424
Aliases: []string{"intro", "i"},
25-
Example: ` # Print metadata of database tables from default config file (gencoder.yaml)
25+
Example: `
26+
# Print metadata of database tables from default config file (gencoder.yaml)
2627
$ gencoder introspect
2728
2829
# Print metadata of database tables from a specific config file

pkg/cmd/root.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ func NewCmdRoot(buildInfo *model.BuildInfo) *cobra.Command {
1717
Version: buildInfo.Version,
1818
Short: "The ultimate code generator",
1919
Long: "gencoder is a code generator that generates code from templates/databases, for any languages/frameworks.",
20-
Example: ` # Generate code from config file (default: gencoder.yaml)
20+
Example: `
21+
# Generate code from config file (default: gencoder.yaml), config json schema: https://raw.githubusercontent.com/DanielLiu1123/gencoder/refs/heads/main/schema.json
2122
$ gencoder generate -f gencoder.yaml
2223
2324
# Generate code from a template project with custom properties
2425
$ gencoder generate --templates "https://github.com/user/template-project" --properties "package=com.example,author=Freeman" --include-non-tpl
25-
26-
# Generate code using custom helpers, read from local file or URL
26+
27+
# Generate code using custom helpers, build-in helpers: https://github.com/DanielLiu1123/gencoder/blob/main/pkg/jsruntime/helper.js
2728
$ gencoder generate --import-helper helpers.js
2829
2930
# Init basic config for quick start

schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://github.com/DanielLiu1123/gencoder/tree/main/pkg/model/table.go",
3+
"$id": "https://github.com/DanielLiu1123/gencoder/blob/main/pkg/model/config.go",
44
"$ref": "#/$defs/Config",
55
"$defs": {
66
"BlockMarker": {

0 commit comments

Comments
 (0)