Skip to content

Commit

Permalink
feat(schema): add schemas for helix-data-embed (#507)
Browse files Browse the repository at this point in the history
schemas for response (either workbook or worksheet + metadata), workbook, worksheet, and row. Response must have `type` and `version` properties now.

see adobe/helix-data-embed#356 (comment)
  • Loading branch information
trieloff authored May 11, 2021
1 parent f5669d7 commit 4563e25
Show file tree
Hide file tree
Showing 34 changed files with 1,384 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@

* [Redirects Configuration](./redirects.md "This configuration file enables the creation of programmatic redirects, rewrites, and vanity URLs")`https://ns.adobe.com/helix/shared/redirects`

* [Response](./data-embed-response.md "The Helix Data Embed Response format")`https://ns.adobe.com/helix/data-embed/response`

* [Row](./row.md "A JSON representation of an Excel or Google Sheets data row")`https://ns.adobe.com/helix/data-embed/row`

* [Runtime Strain](./runtimestrain.md "A runtime strain is a combination of code and content that enables the creation of a digital experience")`https://ns.adobe.com/helix/shared/runtimestrain`

* [Strains](./strains.md)`https://ns.adobe.com/helix/shared/strains`
Expand All @@ -48,6 +52,10 @@

* [Version Lock](./version-lock.md "The version-lock property allows pinning of specific services to a particular version number")`https://ns.adobe.com/helix/shared/version-lock`

* [Workbook](./workbook.md "A JSON representation of an Excel or Google Sheets workbook containing multiple sheets")`https://ns.adobe.com/helix/data-embed/workbook`

* [Worksheet](./sheet.md "A JSON representation of an Excel or Google Sheets worksheet containing rows and columns")`https://ns.adobe.com/helix/data-embed/sheet`

## Other Schemas

### Objects
Expand Down Expand Up @@ -78,6 +86,8 @@

* [Redirect Rule](./proxystrain-properties-redirects-redirect-rule.md "A strain is a combination of code and content that enables the creation of a digital experience")`https://ns.adobe.com/helix/shared/redirectrule#/properties/redirects/items`

* [Row](./sheet-properties-data-row.md "A JSON representation of an Excel or Google Sheets data row")`https://ns.adobe.com/helix/data-embed/row#/properties/data/items`

* [Runtime Strain](./strains-definitions-anystrain-oneof-runtime-strain.md "A runtime strain is a combination of code and content that enables the creation of a digital experience")`https://ns.adobe.com/helix/shared/runtimestrain#/definitions/anystrain/oneOf/1`

* [Single-Value Property](./property-oneof-single-value-property.md "The property in an index")`https://ns.adobe.com/helix/shared/property#/oneOf/0`
Expand Down Expand Up @@ -106,6 +116,10 @@

* [Version Lock](./proxystrain-properties-version-lock.md)`https://ns.adobe.com/helix/shared/version-lock#/properties/version-lock`

* [Workbook](./data-embed-response-allof-0-oneof-workbook.md "A JSON representation of an Excel or Google Sheets workbook containing multiple sheets")`https://ns.adobe.com/helix/data-embed/workbook#/allOf/0/oneOf/1`

* [Worksheet](./data-embed-response-allof-0-oneof-worksheet.md "A JSON representation of an Excel or Google Sheets worksheet containing rows and columns")`https://ns.adobe.com/helix/data-embed/sheet#/allOf/0/oneOf/0`

### Arrays

* [Untitled array in Conditions](./conditions-properties-and.md "All conditions in this list must be met")`https://ns.adobe.com/helix/shared/conditions#/properties/and`
Expand Down Expand Up @@ -162,6 +176,14 @@

* [Untitled array in Strains](./strains-oneof-0.md "A list of strains")`https://ns.adobe.com/helix/shared/strains#/oneOf/0`

* [Untitled array in Workbook](./workbook-properties-names.md "The list of sheet names that exist in the workbook response")`https://ns.adobe.com/helix/data-embed/workbook#/properties/:names`

* [Untitled array in Workbook](./workbook-properties-names.md "The list of sheet names that exist in the workbook response")`https://ns.adobe.com/helix/data-embed/workbook#/properties/:names`

* [Untitled array in Worksheet](./sheet-properties-data.md "The data rows that are part of the result set")`https://ns.adobe.com/helix/data-embed/sheet#/properties/data`

* [Untitled array in Worksheet](./sheet-properties-data.md "The data rows that are part of the result set")`https://ns.adobe.com/helix/data-embed/sheet#/properties/data`

## Version Note

The schemas linked above follow the JSON Schema Spec version: `http://json-schema.org/draft-07/schema#`
120 changes: 120 additions & 0 deletions docs/data-embed-response-allof-0-oneof-workbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Workbook Schema

```txt
https://ns.adobe.com/helix/data-embed/workbook#/allOf/0/oneOf/1
```

A JSON representation of an Excel or Google Sheets workbook containing multiple sheets.

| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | :--------- | :---------- | :----------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------------------- |
| Can be instantiated | No | Stabilizing | No | Forbidden | Forbidden | none | [data-embed-response.schema.json*](data-embed-response.schema.json "open original schema") |

## 1 Type

`object` ([Workbook](data-embed-response-allof-0-oneof-workbook.md))

# 1 Properties

| Property | Type | Required | Nullable | Defined by |
| :------------------- | :------------ | :------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------- |
| [:type](#type) | Not specified | Optional | cannot be null | [Workbook](workbook-properties-type.md "https://ns.adobe.com/helix/data-embed/workbook#/properties/:type") |
| [:names](#names) | `array` | Required | cannot be null | [Workbook](workbook-properties-names.md "https://ns.adobe.com/helix/data-embed/workbook#/properties/:names") |
| [:version](#version) | `number` | Optional | cannot be null | [Workbook](workbook-properties-version.md "https://ns.adobe.com/helix/data-embed/workbook#/properties/:version") |
| `^[^:].*` | `object` | Optional | cannot be null | [Workbook](data-embed-response-allof-0-oneof-worksheet.md "https://ns.adobe.com/helix/data-embed/sheet#/patternProperties/^[^:].*") |

## :type

The response type, depending on the presence of the `sheet` request parameter.

`:type`

* is optional

* Type: unknown

* cannot be null

* defined in: [Workbook](workbook-properties-type.md "https://ns.adobe.com/helix/data-embed/workbook#/properties/:type")

### :type Type

unknown

### :type Constraints

**constant**: the value of this property must be equal to:

```json
"multi-sheet"
```

## :names

The list of sheet names that exist in the workbook response.

`:names`

* is required

* Type: `string[]`

* cannot be null

* defined in: [Workbook](workbook-properties-names.md "https://ns.adobe.com/helix/data-embed/workbook#/properties/:names")

### :names Type

`string[]`

## :version

The workbook response format version

`:version`

* is optional

* Type: `number`

* cannot be null

* defined in: [Workbook](workbook-properties-version.md "https://ns.adobe.com/helix/data-embed/workbook#/properties/:version")

### :version Type

`number`

### :version Constraints

**enum**: the value of this property must be equal to one of the following values:

| Value | Explanation |
| :---- | :---------- |
| `3` | |

### :version Default Value

The default value is:

```json
3
```

## Pattern: `^[^:].*`

A JSON representation of an Excel or Google Sheets worksheet containing rows and columns.

`^[^:].*`

* is optional

* Type: `object` ([Worksheet](data-embed-response-allof-0-oneof-worksheet.md))

* cannot be null

* defined in: [Workbook](data-embed-response-allof-0-oneof-worksheet.md "https://ns.adobe.com/helix/data-embed/sheet#/patternProperties/^\[^:].\*")

### ^\[^:].\* Type

`object` ([Worksheet](data-embed-response-allof-0-oneof-worksheet.md))
170 changes: 170 additions & 0 deletions docs/data-embed-response-allof-0-oneof-worksheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# Worksheet Schema

```txt
https://ns.adobe.com/helix/data-embed/sheet#/allOf/0/oneOf/0
```

A JSON representation of an Excel or Google Sheets worksheet containing rows and columns.

| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | :--------- | :---------- | :----------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------------------- |
| Can be instantiated | No | Stabilizing | No | Forbidden | Forbidden | none | [data-embed-response.schema.json*](data-embed-response.schema.json "open original schema") |

## 0 Type

`object` ([Worksheet](data-embed-response-allof-0-oneof-worksheet.md))

# 0 Properties

| Property | Type | Required | Nullable | Defined by |
| :------------------- | :------------ | :------- | :------------- | :---------------------------------------------------------------------------------------------------------- |
| [:type](#type) | Not specified | Optional | cannot be null | [Worksheet](sheet-properties-type.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/:type") |
| [limit](#limit) | `integer` | Required | cannot be null | [Worksheet](sheet-properties-limit.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/limit") |
| [offset](#offset) | `integer` | Required | cannot be null | [Worksheet](sheet-properties-offset.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/offset") |
| [total](#total) | `integer` | Required | cannot be null | [Worksheet](sheet-properties-total.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/total") |
| [data](#data) | `array` | Required | cannot be null | [Worksheet](sheet-properties-data.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/data") |
| [:version](#version) | `number` | Optional | cannot be null | [Worksheet](sheet-properties-version.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/:version") |

## :type

The response type, depending on the presence of the `sheet` request parameter.

`:type`

* is optional

* Type: unknown

* cannot be null

* defined in: [Worksheet](sheet-properties-type.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/:type")

### :type Type

unknown

### :type Constraints

**constant**: the value of this property must be equal to:

```json
"sheet"
```

## limit

The maximum number of items requested by the `limit` parameter.

`limit`

* is required

* Type: `integer`

* cannot be null

* defined in: [Worksheet](sheet-properties-limit.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/limit")

### limit Type

`integer`

### limit Constraints

**minimum**: the value of this number must greater than or equal to: `0`

## offset

The starting row that items have been retrieved by as specified by the `offset` parameter.

`offset`

* is required

* Type: `integer`

* cannot be null

* defined in: [Worksheet](sheet-properties-offset.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/offset")

### offset Type

`integer`

### offset Constraints

**minimum**: the value of this number must greater than or equal to: `0`

## total

The total number of items in the data sheet. This value can be greater than the sum of `limit` and `offset`

`total`

* is required

* Type: `integer`

* cannot be null

* defined in: [Worksheet](sheet-properties-total.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/total")

### total Type

`integer`

### total Constraints

**minimum**: the value of this number must greater than or equal to: `0`

## data

The data rows that are part of the result set

`data`

* is required

* Type: `object[]` ([Row](sheet-properties-data-row.md))

* cannot be null

* defined in: [Worksheet](sheet-properties-data.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/data")

### data Type

`object[]` ([Row](sheet-properties-data-row.md))

## :version

The workbook response format version

`:version`

* is optional

* Type: `number`

* cannot be null

* defined in: [Worksheet](sheet-properties-version.md "https://ns.adobe.com/helix/data-embed/sheet#/properties/:version")

### :version Type

`number`

### :version Constraints

**enum**: the value of this property must be equal to one of the following values:

| Value | Explanation |
| :---- | :---------- |
| `3` | |

### :version Default Value

The default value is:

```json
3
```
21 changes: 21 additions & 0 deletions docs/data-embed-response-allof-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Untitled undefined type in Response Schema

```txt
https://ns.adobe.com/helix/data-embed/response#/allOf/0
```



| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [data-embed-response.schema.json*](data-embed-response.schema.json "open original schema") |

## 0 Type

merged type ([Details](data-embed-response-allof-0.md))

one (and only one) of

* [Worksheet](data-embed-response-allof-0-oneof-worksheet.md "check type definition")

* [Workbook](data-embed-response-allof-0-oneof-workbook.md "check type definition")
Loading

0 comments on commit 4563e25

Please sign in to comment.