-
Notifications
You must be signed in to change notification settings - Fork 0
cli_reference
Francisco Dias edited this page Jun 30, 2026
·
4 revisions
GMSwaggerCodeGen.exe -i <spec> -o <dir> [--prefix <name>] [--lang <targets>]
Path to the OpenAPI 3.x specification file.
-i openapi.json
-i path\to\spec.yamlBoth JSON and YAML are supported. The format is auto-detected from the file extension
(.yaml / .yml → YAML; anything else → JSON).
Note: the help text says "Path or URL" but URL input is not implemented — the tool checks
FileInfo.Existsimmediately and will fail if given a URL.
Output directory for generated files. Created automatically if it does not exist.
-o ./out # relative
-o D:\gen\myapi # absoluteDefault: build
The namespace prefix used for all generated names. Affects four naming patterns:
| Pattern | Example (gm) |
Example (myapi) |
|---|---|---|
| Public functions | gm_ |
myapi_ |
| Private helpers | _gm_ |
_myapi_ |
| Struct names | Gm |
Myapi |
| Macros / constants | GM_ |
MYAPI_ |
Default: gm
See Naming Conventions for full details.
Comma-separated list of output targets. Available targets:
| Target | Output |
|---|---|
gml |
generated_schemas.gml, generated_http.gml, generated_helpers.gml, controller_*.gml
|
docs |
schemas_codegen.js, function_codegen.js (gm-ext doc stubs) |
--lang gml # GML only
--lang docs # doc stubs only
--lang gml,docs # both (default)Default: gml,docs
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Argument parse error |
2 |
Input file not found |
3 |
Unknown --lang target |
# Basic — JSON spec, output to ./out, default prefix
GMSwaggerCodeGen.exe -i openapi.json -o out
# YAML spec with custom prefix
GMSwaggerCodeGen.exe -i spec.yaml -o out --prefix petstore
# GML only (skip doc stubs)
GMSwaggerCodeGen.exe -i openapi.json -o out --lang gml
# Docs only (for updating an existing integration)
GMSwaggerCodeGen.exe -i openapi.json -o out --lang docsGameMaker