Skip to content

Commit 8103a08

Browse files
committed
fix: use openapi content schema, misc fixes
This contains a series of fixes to get aepcli to work off of parsing the unmodified roblox api. A few areas of note: aepcli was using incorrect schemas previously, which assumed the schema was directly under the response rather than under a content map. the help text was not very legible when called from the api name, making that into a list makes it possible to find the resources. There are no ways to handle singletons nor custom methods currently - therefore those are skipped. There are also scenarios where additional dereferencing is needed - so added support for arbitrary dereferencing. As a shortcut, fields that are references in a resource schema are just defaulted to being handled as arbtirary json objects. In the future we can add more nested validation.
1 parent acc062d commit 8103a08

6 files changed

Lines changed: 15571 additions & 297 deletions

File tree

cmd/aepcli/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func aepcli() error {
6969
os.Exit(1)
7070
}
7171
fileOrAlias = filepath.Join(cd, api.OpenAPIPath)
72-
if api.PathPrefix == "" {
72+
if pathPrefix == "" {
7373
pathPrefix = api.PathPrefix
7474
}
7575
rawHeaders = append(rawHeaders, api.Headers...)
@@ -126,7 +126,7 @@ func setLogLevel(levelAsString string) error {
126126
case "error":
127127
level = slog.LevelError
128128
default:
129-
return fmt.Errorf("invalid log level:", levelAsString)
129+
return fmt.Errorf("invalid log level: %v", levelAsString)
130130
}
131131
slog.SetLogLoggerLevel(level)
132132
return nil

0 commit comments

Comments
 (0)