Create JSON Schema for API Gateway Methods
The util create-invoke-methods-schema
command is used to create JSON schema definitions for methods in a given assembly. This command is invoked automatically by LambdaSharp during compilation when a module specifies target methods for Api
or WebSocket
routes.
Options
--default-namespace|-ns <DEFAULT-NAMESPACE>
-
(optional) Default namespace for resolving class names
--directory|-d <DIRECTORY-PATH>
-
Directory where .NET assemblies are located
--method|-m <METHOD-NAME>
-
Name of a method to analyze
--out|-o <OUTPUT-FILE>
-
(optional) Output schema file location (default: console out)
--quiet
-
(optional) Don't show banner or execution time
--no-beep
-
(optional) Don't emit beep when finished
Examples
Create JSON Schema for WebSocketsSample.MessageFunction.Function::SendMessageAsync
Using Bash:
lash util create-invoke-methods-schema \
--directory MessageFunction/bin/Release/netcoreapp3.1/publish/ \
--method MessageFunction::WebSocketsSample.MessageFunction.Function::SendMessageAsync
Using PowerShell:
lash util create-invoke-methods-schema ^
--assembly MessageFunction/bin/Release/netcoreapp3.1/publish/ ^
--method MessageFunction::WebSocketsSample.MessageFunction.Function::SendMessageAsync
Output:
LambdaSharp CLI (v0.6) - Create JSON schemas for API Gateway invoke methods
Inspecting method invocation targets in MessageFunction/bin/Release/netcoreapp3.1/publish/MessageFunction.dll
... WebSocketsSample.MessageFunction.Function::SendMessageAsync: Message -> (void)
{
"WebSocketsSample.MessageFunction.Function::SendMessageAsync": {
"Assembly": "MessageFunction",
"Type": "WebSocketsSample.MessageFunction.Function",
"Method": "SendMessageAsync",
"RequestContentType": "application/json",
"RequestSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Message",
"type": "object",
"required": [
"action",
"from",
"text"
],
"properties": {
"action": {
"type": "string"
},
"from": {
"type": "string"
},
"text": {
"type": "string"
}
}
},
"ResponseContentType": null,
"ResponseSchema": "Void",
"Error": null
}
}
Done (finished: 4/9/2019 4:40:09 PM; duration: 00:00:00.5159812)