Skip to content

Commit e33c548

Browse files
committed
refactor(schema): add use "SchemaJSON" instead of "JSON" suffix on embedding names
1 parent 873522f commit e33c548

File tree

3 files changed

+205
-190
lines changed

3 files changed

+205
-190
lines changed

gen/schema/internal/generator/generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ func goName(name string) string {
8585
tkns[i] = strings.ToUpper(string(tkn[0])) + tkn[1:]
8686
}
8787

88-
return strings.Join(tkns, "") + "JSON"
88+
return strings.Join(tkns, "") + "SchemaJSON"
8989
}

pkg/schema/schema.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//go:generate go tool schema
2+
3+
// Package schema contains the "raw" JSONSchema source for each OpenRPC
4+
// method defined by Ethereum's execution APIs.
5+
package schema
6+
7+
// import "encoding/json"
8+
9+
// // Schema returns the JSONSchema source for the Ethereum method with the
10+
// // matching name.
11+
// func Schema(name string) (json.RawMessage, bool) {
12+
// schema, ok := Schemas()[name]
13+
14+
// return schema, ok
15+
// }

0 commit comments

Comments
 (0)