-
Notifications
You must be signed in to change notification settings - Fork 0
home
Francisco Dias edited this page Jul 1, 2026
·
6 revisions
GM-SwaggerCodeGen reads an OpenAPI 3.x specification (JSON or YAML) and generates a complete GameMaker Language (GML) HTTP client layer — typed schema structs, endpoint wrapper functions, an authentication helper, a cookie jar, and a controller object you paste into a manager object.
-
Schema structs — each
#/components/schemasobject becomes a GML constructor with per-field runtime type validation. - Endpoint wrappers — one GML function per API operation: builds the URL, handles path/query/header/cookie parameters, serialises the request body to the right content-type, attaches auth tokens, and fires the HTTP request.
-
Auth layer — reads
components.securitySchemes, generates token storage/retrieval helpers, and injects credentials (Basic, Bearer, API key, OAuth 2) per request automatically. -
Cookie jar — transparently captures
Set-Cookieresponse headers and injects them into every subsequent request. A public API lets game code read, write, and clear cookies manually. -
Body converters — built-in serialisers for
application/json,application/x-www-form-urlencoded,multipart/form-data, andtext/plain. Custom converters can be registered at runtime. - Response hooks — register per-HTTP-status-code intercept functions that run before the callback.
-
Documentation stubs — optional
--lang docsoutput generatesgm-ext-compatible JS doc files for the online/offline wiki pipeline.
openapigen.exe --init ./myapi
# edit myapi/config.json — set "Input" to your spec path
openapigen.exe --config ./myapi/config.jsonCopy the output files into your GameMaker project and paste the three controller snippets into
obj_gm_core's Create, Async HTTP, and Cleanup events.
- Getting Started — build, first run, wiring the output into a GameMaker project.
- CLI Reference — every flag and option.
- Generated Output — what each file contains and how to use it.
- Authentication & Cookies — auth schemes, token management, the cookie jar.
- Naming Conventions — how function and struct names are derived from the spec.
- .NET 9 SDK (build and run)
- An OpenAPI 3.x document (JSON or YAML)
- GameMaker 2024+ for the generated GML
GameMaker