Skip to content
Snippets Groups Projects
Commit 6898d93b authored by Lars Trieloff's avatar Lars Trieloff
Browse files

[trivial] point out type within arrays

parent 6c574b66
Branches
Tags
No related merge requests found
...@@ -38,19 +38,14 @@ This is an array ...@@ -38,19 +38,14 @@ This is an array
### list Type ### list Type
Unknown type `array`.
Array type: `string[]`.
```json
{ All items must be of the type:
"type": "array", `string`
"description": "This is an array",
"items": {
"type": "string",
"simpletype": "`string`"
},
"simpletype": "`string[]`"
}
```
...@@ -68,19 +63,15 @@ This is an array of arrays ...@@ -68,19 +63,15 @@ This is an array of arrays
### listlist Type ### listlist Type
Unknown type `array`.
Array type: `array[]`.
```json
{ All items must be of the type:
"type": "array", Nesting alarm!
"description": "This is an array of arrays",
"items": { Array type: `array`.
"type": "array",
"simpletype": "`array`"
},
"simpletype": "`array[]`"
}
```
...@@ -98,23 +89,21 @@ This is an array of arrays of strings ...@@ -98,23 +89,21 @@ This is an array of arrays of strings
### stringlistlist Type ### stringlistlist Type
Unknown type `array`.
Array type: `string[][]`.
```json
{ All items must be of the type:
"type": "array", Nesting alarm!
"description": "This is an array of arrays of strings",
"items": { Array type: `string[]`.
"type": "array",
"items": { All items must be of the type:
"type": "string", `string`
"simpletype": "`string`"
},
"simpletype": "`string[]`"
},
"simpletype": "`string[][]`"
}
```
...@@ -132,21 +121,14 @@ This is an array ...@@ -132,21 +121,14 @@ This is an array
### intlist Type ### intlist Type
Unknown type `array`.
Array type: `integer[]`.
```json
{ All items must be of the type:
"type": "array", `integer`
"description": "This is an array",
"items": {
"type": "integer",
"simpletype": "`integer`"
},
"maxItems": 10,
"minItems": 1,
"simpletype": "`integer[]`"
}
```
...@@ -164,20 +146,12 @@ This is an array ...@@ -164,20 +146,12 @@ This is an array
### boollist Type ### boollist Type
Unknown type `array`.
Array type: `boolean[]`.
```json
{ All items must be of the type:
"type": "array", `boolean`
"description": "This is an array",
"items": {
"type": "boolean",
"simpletype": "`boolean`"
},
"minItems": 1,
"simpletype": "`boolean[]`"
}
```
...@@ -195,20 +169,14 @@ This is an array ...@@ -195,20 +169,14 @@ This is an array
### numlist Type ### numlist Type
Unknown type `array`.
Array type: `number[]`.
```json
{ All items must be of the type:
"type": "array", `number`
"description": "This is an array", * minimum value: `10`
"items": {
"type": "number",
"simpletype": "`number`"
},
"maxItems": 10,
"simpletype": "`number[]`"
}
```
......
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
"type": "array", "type": "array",
"description": "This is an array", "description": "This is an array",
"items": { "items": {
"type": "number" "type": "number",
"minimum": 10
}, },
"maxItems": 10 "maxItems": 10
} }
......
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
"type":"array", "type":"array",
"description": "This is an array", "description": "This is an array",
"items": { "items": {
"type": "number" "type": "number",
"minimum": 10
}, },
"maxItems": 10 "maxItems": 10
} }
......
<% /**
* Copyright 2017 Adobe Systems Incorporated. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*/ %>
Array type: <%=schema.simpletype %>.
<% if (schema.items!==undefined) { %>
All items must be of the type:<%
if (schema.items.type==="string") {
%><%- include("string-type",{schema:schema.items,_:_})
%><% } else if (schema.items.type==="number"||schema.items.type==="integer") {
%><%- include("number-type",{schema:schema.items,_:_})
%><% } else if (schema.items.type==="boolean") {
%><%- include("boolean-type",{schema:schema.items,_:_})
%><% } else if (schema.items.type==="array") { %>
Nesting alarm!
<%- include("array-type",{schema:schema.items,_:_}) %>
<% } else { %>
Unknown type `<%= schema.type %>`.
```json
<%- JSON.stringify(schema, null, 2) %>
```
<% } %>
<% } %>
...@@ -41,6 +41,8 @@ The value of this property **must** be equal to one of the [known values below]( ...@@ -41,6 +41,8 @@ The value of this property **must** be equal to one of the [known values below](
<%- include("number-type",{schema:schema,_:_}) %> <%- include("number-type",{schema:schema,_:_}) %>
<% } else if (schema.type==="boolean") { %> <% } else if (schema.type==="boolean") { %>
<%- include("boolean-type",{schema:schema,_:_}) %> <%- include("boolean-type",{schema:schema,_:_}) %>
<% } else if (schema.type==="array") { %>
<%- include("array-type",{schema:schema,_:_}) %>
<% } else { %> <% } else { %>
Unknown type `<%= schema.type %>`. Unknown type `<%= schema.type %>`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment