%REST.Spec
Class %REST.Spec [ Abstract, System = 3 ]
This superclass is used as a known entry point for OpenAPI REST API Models. Subclasses of this class should override the XData OpenAPI block for storing custom API descriptions.
Parameters
XDataName
Parameter XDataName = "OpenAPI";
The name of the XData block which contains the OpenAPI 2.0 specification
Strict
Parameter Strict As STRING = 1;
If Strict=0 (false), then only the swagger properties which are needed for code generation are checked during compile. If Strict=1 (true), then all swagger properties are checked during compile.
XDatas
OpenAPI
XData OpenAPI [ MimeType = application/json ]
Storage space for the swagger document.
Methods
%CreateRESTApplication
ClassMethod %CreateRESTApplication(applicationName As %String, swagger = "", ByRef features, Output newApplication As %Boolean) As %Status [ Internal ]
Create a REST application. If the REST application already exists, then it will be replaced. The swagger argument contains the OpenAPI 2.0 swagger document for the application. If xdataStream="", then the RESTSpec will be empty.
If the request body is empty, the addPing feature determines if a ping method should be added to the empty swagger spec. The REST application package containing 3 classes:
The specification class (.spec) which is created with the specified OpenAPI XData block.
The dispatch class (.disp) which is deleted for a new application and will be created by compile
The implementation class (.impl) which is updated as needed with other contents unchanged.
CreateParameter
ClassMethod CreateParameter(classDef As %Dictionary.ClassDefinition, name As %String, value As %String, desc As %String) As %Status [ Internal ]
Create a parameter
%DeleteRESTApplication
ClassMethod %DeleteRESTApplication(applicationName As %String, Output newApplication As %Boolean) As %Status [ Internal ]
Delete a new REST application including the implementation class.
%RemoveXDataBlock
ClassMethod %RemoveXDataBlock(cDef, blockName) [ Internal ]
%OnCompile
ClassMethod %OnCompile() [ CodeMode = objectgenerator, Internal ]