vmTemplates.resource.vm Maven / Gradle / Ivy
Resource::$resource.name
#parse("vmTemplates/_nav.vm")
$resourceFullName Resource
#if ($resource.doc)
- Documentation
- $resource.doc
#end
- Resource Type
- $resourceType
#if ($resourceType == "collection")
- Key
#set ($identifier = $resource.collection.identifier)
#if ($identifier.params)
#set ($identifierType = "$identifier.type")
#set ($identifierParams = "- Parameter schema: $identifier.params
")
#else
#set ($identifierType = $identifier.type)
#set ($identifierParams = "")
#end
- $identifier.name: $identifierType
$identifierParams
#elseif ($resourceType == "association")
#set ($assocKeyMap = {})
- Keys
#foreach ($assocKey in $resource.association.assocKeys)
- $assocKey.name: $assocKey.type
#set ($discard = $assocKeyMap.put($assocKey.name, $assocKey.type))
#end
#end
#if ($resource.hasSchema())
- Item Type
- $resource.schema
#end
#if ($subResources)
- Subresources
#foreach ($subResource in $subResources)
-
$resourceName.$subResource.name
#end
#end
#if (!$relatedSchemas.isEmpty())
- Related Data Schemas
#foreach ($recordDataSchema in $relatedSchemas)
- $recordDataSchema.fullName
#end
#end
#if (!$restMethods.isEmpty())
REST Methods
Method
Example Path
Doc
#foreach ($methodDocView in $restMethods)
$methodDocView.restMethodSchema.method
#if ($methodDocView.capture) $serverNodeUri$methodDocView.capture.request.URI #end
$!methodDocView.doc
#end
#end
#if (!$finders.isEmpty())
Finders
#foreach ($finder in $finders)
#set ($finderSchema = $finder.finderSchema)
- $finderSchema.name
$!finderSchema.doc
#if ($finderSchema.assocKeys)
-
- AssocKeys
-
#foreach ($assocKeyName in $finderSchema.assocKeys)
-
$assocKeyName: $assocKeyMap.get($assocKeyName)
#end
#end
#if ($finderSchema.parameters)
-
- Parameters
-
#foreach ($param in $finderSchema.parameters)
-
$param.name:
#if ($relatedSchemas.containsKey($param.type))
$param.type
#else
$param.type
#end
#if ($param.hasItems())
<
#if ($relatedSchemas.containsKey($param.items))
$param.items
#else
$param.items
#end
>
#end
#end
#end
curl -v -X GET $serverNodeUri$finder.capture.request.URI
-
GET $serverNodeUri$finder.capture.request.URI HTTP/1.1
HTTP/1.1 $finder.capture.response.status OK
#foreach ($headerName in $finder.capture.response.headers.keySet())
$headerName: $finder.capture.response.headers.get($headerName)
#end
$finder.prettyPrintResponseEntity
#end
#end
#if (!$actions.isEmpty())
Actions
#foreach ($action in $actions)
#set ($actionSchema = $action.actionSchema)
- $actionSchema.name
$!actionSchema.doc
#if ($actionSchema.parameters || $actionSchema.hasReturns() || $actionSchema.hasThrows())
-
#if ($actionSchema.parameters)
- Parameters
-
#foreach ($param in $actionSchema.parameters)
-
$param.name:
#if ($relatedSchemas.containsKey($param.type))
$param.type
#else
$param.type
#end
#if ($param.hasItems())
<
#if ($relatedSchemas.containsKey($param.items))
$param.items
#else
$param.items
#end
>
#end
#end
#end
#if ($actionSchema.hasReturns())
- Returns
-
#if ($relatedSchemas.containsKey($actionSchema.returns))
$actionSchema.returns
#else
$actionSchema.returns
#end
#end
#if ($actionSchema.hasThrows())
- Exceptions
-
#foreach ($error in $actionSchema.throws)
$error
#end
#end
#end
#if ($action.capture)
-
curl -v -X POST $serverNodeUri$action.capture.request.URI #if ($action.prettyPrintRequestEntity)-d @request_body #end
#if ($action.prettyPrintRequestEntity)
request_body file:
$action.prettyPrintRequestEntity
#end
-
GET $serverNodeUri$action.capture.request.URI HTTP/1.1
HTTP/1.1 $action.capture.response.status OK
#foreach ($headerName in $action.capture.response.headers.keySet())
$headerName: $action.capture.response.headers.get($headerName)
#end
#if ($action.prettyPrintResponseEntity)
$action.prettyPrintResponseEntity
#end
#end
#end
#end
#include("vmTemplates/_footer.html")
© 2015 - 2025 Weber Informatics LLC | Privacy Policy