Manifest
Use the Elements Manifest to keep a record of all your endpoint and model definitions, define your security model, and set up handlers for startup and other events in your game or application.
The manifest is a Lua table containing all of the endpoint and model definitions. It is also where you can define the security model and set up handlers for startup and various other events, such as new Profile creation.
The manifest will automatically be loaded from main.lua at the root of your project. See a sample here.
Model
All model objects that will be used for client code generation, request parameters, and response objects, must be defined here.
The anatomy of a model object is as such:
description - (string) A description of the model object
properties - (table) A list of properties for this object. This follows two formats:
(property name) - Basic types
description
type
(property name) - Arrays or custom types
description
type
model
Valid Property Types:
"string"
"number"
"integer"
"boolean"
"object"
"array"
Example code:
It is also possible to create a Pagination of any of your model objects here as well! This will allow you to fetch subsets of larger data sets when you want to stagger their retrieval from the client side.
HTTP
The manifest's HTTP definitions are your custom endpoint definitions. Everything that you define here will be found in DefaultApi in the generated client code, as well as tell Elements which endpoint handler functions to call when the client makes a request.
Startup
Runs the specified scripts whenever Elements launches. This will include restarts made for code changes.
If your startup script creates a new resource, you should check if it has already been created before creating a new one.
Events
Events allow you to add special functionality to certain Elements events.
Currently supported events:
"com.namazustudios.elements.service.profile.created" - a new Profile creation event
More coming soon!
Security
Last updated