Hide Comments

The objectResouce element describes how an instance of a particular data type is exposed by the API and how it may be accessed. Object Resources are bound to a Data Structure from an accessible Data Model. An objectResource is a reference to a single resource object which is always realized as embedded (it would make no sense to realize the object as a hyperlink to another object resource).

Syntax

[default] objectResource  <resource-name> [~bound ~to] type <bound-data-structure>

[<uri>]

[<secured>]

[<property-set>]

[<reference-embed> | <reference-link>]...

[<link-descriptor-definition>]...

[<media-types>]

[<method>]...

[<example>]...

Examples

default objectResource PersonObject type Person

URI people/{id}

secured by

auth.Basic

// Combined Property Set: uses including and excluding keywords

with all properties

including

taxpayerID!

ssn

matching regex '(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}'

exluding

otherNames

// Reference treatment: embedded

referenceLink > addresses

linkDescriptor MyResourceLink

firstName

lastName

mediaTypes

application/json

method GET getPersonObject

method PUT putPersonObject

example ''' Any text can go here '''

example ''' But this should show what a legal message from this resource should look like '''

Parameters

Name

Type

Description

default

keyword

Explicitly designates this Object Resource as the default hyperlink target for references to the bound Data Structure.  See Automatic Linking and Embedding for a full explanation.

<resource-name>

Name

The Name assigned to this resource. Unique in the context of the containing Resource API.

<bound-data-structure>

QName(Data Structure)

A reference to the underlying Data Structure bound to this Object Resource.

Child Elements

Name

Topic

Description

<uri>

URI

The URI of this resource, relative to the baseURI of the containing Resource API.

<secured>

Secured

Describes how this resource is secured.

<property-set>

Property Set

Part of the default realization of this resource.

<reference-embed>

Reference Embed

Part of the default realization of this resource.

<reference-link>

Reference Link

Part of the default realization of this resource.

<link-descriptor-definition>

Link Descriptor Definition

A reusable descriptor for use in Reference Links from other resources.

<media-types>

Media Types

The default media types supported by this resource.

<method>

Method

An HTTP method definition.

<example>

Example

An example of what valid data passing to/from this resource should look like.

Parent Elements

Resource API

Created with Help & Manual 6 and styled with Premium Pack Version 2.51 © by EC Software