TIBCO EBX®
Documentation > Developer Guide > REST data services > JSON Formats
Navigation modeDocumentation > Developer Guide > REST data services > JSON Formats

Common

Introduction

The common specifications are used in both compact and Extended formats.

Global structure

JSON Response body

Form data category

The response body contains a JSON Object per handled resources. That is, the JSON root Object for a single handled resource is a JSON Object as well as for multiple handled resources. The several properties are directly placed into the JSON Object.

Form validation report

This report can be retrieve by using the Form data operations. It provides every validation constraint on the requested resource.

Those constraints have the following properties:

JSON property

JSON format

Description

Required

message

String

Description of the constraint.

Yes

blocksCommit

String

Control policy of the constraint. The possible values are: onInsertUpdateOrDelete, onUserSubmit-checkModifiedValues, never.

See Blocking and non-blocking constraints for more information.

Yes

level

String

Severity level of the constraint. The possible values are: info, warning, error or fatal.

Yes

pathInDataset

String

Relative field path starting from the schema node.

No(**)

pathInRecord

String

Relative field path starting from the table node.

No (*)

(*) Only available for record and record field operations.

(**) Only available for dataset operations.

Content

Pagination

This feature allows to return a limited and parameterizable number of data. Pagination can be applied to data of the following types: records, association values, selection node values, selectors and dataspaces. A context named pagination is always returned. This context allows browsing data similarly to the UI.

The pagination is always enabled.

Detailed information related to this context can be found hereafter:

JSON property

JSON format

Description

Required

firstPage

String or null (*)

URL to access the first page.

Yes (**)

previousPage

String or null (*)

URL to access the previous page.

Yes (**)

nextPage

String or null (*)

URL to access the next page.

Yes

lastPage

String or null (*)

URL to access the last page.

Yes (**)

Note

(*) Only defines if data is available in this context and not in the response.

Note

(**) Not present on selector.

Content of simple type

XML Schema

JSON format

Examples

Meta type

OpenAPI

xs:string

xs:Name

osd:text

String (Unicode characters, cf. RFC4627)

"A text"

"The escape of \"special character\" is preceded by a backslash."

null

string

name

text

type: string

format: n/a

osd:html

String (Unicode characters, cf. RFC4627)

"<p>An HTML tag can thus be written without trouble</p>"

html

type: string

format: html

osd:email

String (Unicode characters, cf. RFC4627)

"employee@mycompany.com"

email

type: string

format: email

osd:locale

String (Language tag, cf. RFC1766)

"en-US"

locale

type: string

format: locale

xs:string

(Foreign key)

String

contains the value of the formatted foreign key.

"0"

"true|99"

foreignKey

type: string

format: n/a

xs:boolean

Boolean

true

false

null

boolean

type: boolean

format: n/a

xs:decimal

Number or null

-10.5

20.001

15

-1e-13

decimal

type: number

format: double

xs:date

String with format: "yyyy-MM-dd"

"2015-04-13"

date

type: string

format: date

xs:time

String with format:

  • "HH:mm:ss"

  • "HH:mm:ss.SSS"

"11:55:00"

"11:55:00.000"

time

type: string

format: date-time

xs:dateTime

String with format:

  • "yyyy-MM-ddTHH:mm:ss"

  • "yyyy-MM-ddTHH:mm:ss.SSS"

"2015-04-13T11:55:00"

"2015-04-13T11:55:00.000"

dateTime

type: string

format: date-time

xs:anyURI

String (Uniform Resource Identifier, cf. RFC3986)

"https://fr.wikipedia.org/wiki/René_Descartes"

anyURI

type: string

format: uri

xs:int

xs:integer

Number or null

1596

int

type: integer

format: int32

osd:resource

String

contains the resource formatted value.

"ebx-tutorial:ext-images:frontpages/Bach.jpg"

resource

type: string

format: n/a

osd:color

String with format: "#[A-Fa-f0-9]{6}"

contains the formatted value for the color.

"#F6E0E0"

color

type: string

format: n/a

osd:datasetName

String with format: "[a-zA-Z_][-a-zA-Z0-9_.]*" and 64 characters max.

contains the formatted value of the dataset name.

"ebx-tutorial"

dataset

type: string

format: n/a

osd:dataspaceKey

String with format: [BV][a-zA-Z0-9_:.\-\|]+ and 33 characters max.

contains the formatted key value of the dataspace.

"Bebx-tutorial"

dataspace

type: string

format: n/a

Insert operation report

When invoking the insert operation with a record table, it can optionally return a report. The report includes a JSON Object that contains the following properties:

{
  "rows": [
    {
      "code": 204,
      "foreignKey": "62",
      "label": "Claude Debussy",
      "details": "http://.../root/individu/62"
    },
    {
      "code": 201,
      "foreignKey": "195",
      "label": "Camille Saint-Saëns",
      "details": "http://.../root/individu/195"
    }
  ]
}
See also

Delete operation report

When invoking the delete operation, a report is returned. The report includes a JSON Object that contains the following properties:

{
  "deletedCount": 1,
  "inheritedCount": 0,
  "occultedCount": 0
}
See also

Update modes

The byDelta mode allows to ignore data model elements that are missing from the JSON source document. This mode is enabled (by default) through RESTful operations. The following table summarizes the behavior of insert and update operations when elements are not included in the source document.

See the RESTful data services operations update and insert, as well as ImportSpec.setByDelta in the Java API for more information.

State in the JSON source document

Behavior

The property does not exist in the source document

If the byDelta mode is activated (default):

  • For the update operation, the field value remains unchanged.

  • For the insert operation, the behavior is the same as when the byDelta mode is disabled.

If the byDelta mode is disabled through the RESTful operation parameter:

The target field is set to one of the following values:

  • If the element defines a default value, the target field is set to that default value.

  • If the element is of a type other than a string or list, the target field value is set to null.

  • If the element is an aggregated list, the target field value is set to an empty list value.

  • If the element is a string that differentiates null from an empty string, the target field value is set to null. If it is a string that does not differentiate the two, an empty string.

  • If the element (simple or complex) is hidden in the data services, the target value remains unchanged.

Note

The user performing the import must have the required permissions to create or change the target field value. Otherwise, the operation will be aborted.

The element is present and its value is null (for example, "content": null)

The target field is always set to null except for lists, in which case it is not supported.

Known limitations

Field values

The value of fields xs:date, xs:time and xs:dateTime does not contain a time zone associated with the JSON-primitive type.

Indexing and search strategy

Filterable and sortable values from the metadata are limited to the default search strategy.

See also
Documentation > Developer Guide > REST data services > JSON Formats