Skip to content
Snippets Groups Projects
Unverified Commit c40e2dc2 authored by Anjan Kaur's avatar Anjan Kaur Committed by GitHub
Browse files

Merge branch 'master' into feature/57-suppress-schema-output

parents 07530893 45bd5646
Branches
Tags
No related merge requests found
......@@ -208,7 +208,7 @@ All items must be of the type:
`object` with following properties:
| Property | Type | Required
| Property | Type | Required |
|----------|------|----------|
| `a`| string | **Required** |
| `b`| integer | Optional |
......
......@@ -117,7 +117,7 @@ String or number…
`object` with following properties:
| Property | Type | Required
| Property | Type | Required |
|----------|------|----------|
| `foo`| string | Optional |
| `nonfoo`| boolean | Optional |
......
......@@ -208,7 +208,7 @@ All items must be of the type:
`object` with following properties:
| Property | Type | Required
| Property | Type | Required |
|----------|------|----------|
| `a`| string | **Required** |
| `b`| integer | Optional |
......
......@@ -117,7 +117,7 @@ String or number…
`object` with following properties:
| Property | Type | Required
| Property | Type | Required |
|----------|------|----------|
| `foo`| string | Optional |
| `nonfoo`| boolean | Optional |
......
......@@ -5,12 +5,13 @@
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*/ %>
<% const hasDefault = _.keys(props).filter(property => _.has(props, property + '.default')).length > 0; %>
| Property | Type | Required
|----------|------|----------|
| Property | Type | Required |<% if(hasDefault) { %> Default |<% } %>
|----------|------|----------|<% if(hasDefault) { %>---------|<% } %>
<% _.keys(props).sort().forEach(property => {
const schema = props[property]; %>
| `<%= property %>`| <%= schema.type %> | <%= (Array.isArray(outer.required)&&outer.required.indexOf(property)>=0) ? "**Required**" : "Optional" %> |
| `<%= property %>`| <%= schema.type %> | <%= (Array.isArray(outer.required)&&outer.required.indexOf(property)>=0) ? "**Required**" : "Optional" %> |<% if(hasDefault) { %> <% if (schema.default!==undefined) { %>`<%- JSON.stringify(schema.default) %>`<% } %> |<% } %>
<%
});
%>
\ No newline at end of file
......@@ -18,6 +18,8 @@
<% if (schema.maxItems!==undefined&&schema.minItems!==undefined) { %>* between `<%=schema.minItems %>` and `<%=schema.maxItems %>` items in the array<% }
else if (schema.maxItems!==undefined ) { %>* no more than `<%=schema.maxItems %>` items in the array<% }
else if (schema.minItems!==undefined ) { %>* at least `<%=schema.minItems %>` items in the array<% } %>
<% } %><% if (schema.default!==undefined) { %>
* default: `<%- JSON.stringify(schema.default) %>`
<% } %>
<% if (schema.const!==undefined) { %>
......
......@@ -21,6 +21,8 @@ Applies to all properties that match the regular expression `<%=name %>`
<% if (schema.maxItems!==undefined&&schema.minItems!==undefined) { %>* between `<%=schema.minItems %>` and `<%=schema.maxItems %>` items in the array<% }
else if (schema.maxItems!==undefined ) { %>* no more than `<%=schema.maxItems %>` items in the array<% }
else if (schema.minItems!==undefined ) { %>* at least `<%=schema.minItems %>` items in the array<% } %>
<% } %><% if (schema.default!==undefined) { %>
* default: `<%- JSON.stringify(schema.default) %>`
<% } %>
* defined in <% if (schema.$oSchema) { %>[<%= schema.$oSchema.$linkVal %>](<%= schema.$oSchema.$linkPath %>#<%= name %>)<% } else { %>this schema<% } %>
......
......@@ -6,12 +6,13 @@
*/ %>
# <%=title %> Properties
<% const hasDefault = _.keys(props).filter(property => _.has(props, property + '.default')).length > 0; %>
| Property | Type | Required | Defined by |
|----------|------|----------|------------|
| Property | Type | Required |<% if(hasDefault) { %> Default |<% } %> Defined by |
|----------|------|----------|<% if(hasDefault) { %>---------|<% } %>------------|
<% _.keys(props).sort().forEach(property => {
const schema = props[property]; %>
| [<%= property %>](#<%= propertiesSlugs[property] %>) | <%= schema.simpletype %> | <%= schema.isrequired === true ? "**Required**" : "Optional" %> | <%
| [<%= property %>](#<%= propertiesSlugs[property] %>) | <%= schema.simpletype %> | <%= schema.isrequired === true ? "**Required**" : "Optional" %> |<% if(hasDefault) { %> <% if (schema.default!==undefined) { %>`<%- JSON.stringify(schema.default) %>`<% } %> |<% } %> <%
if (schema.$oSchema) {
%>[<%= schema.$oSchema.$linkVal %>](<%= schema.$oSchema.$linkPath %>#<%= propertiesSlugs[property] %>)<%
} else {
......@@ -20,7 +21,7 @@
});
%><% _.keys(pprops).forEach(property => {
const schema = pprops[property]; %>
| `<%= property.replace(':', '') %>` | <%= schema.simpletype %> | Pattern | <%
| `<%= property.replace(':', '') %>` | <%= schema.simpletype %> | Pattern |<% if(hasDefault) { %> <% if (schema.default!==undefined) { %>`<%- JSON.stringify(schema.default) %>`<% } %> |<% } %> <%
if (schema.$oSchema) {
%>[<%= schema.$oSchema.$linkVal %>](<%= schema.$oSchema.$linkPath %>#<%= property.replace(':', '').toLowerCase() %>)<%
} else {
......
......@@ -18,6 +18,8 @@
<% if (schema.maxItems!==undefined&&schema.minItems!==undefined) { %>* between `<%=schema.minItems %>` and `<%=schema.maxItems %>` items in the array<% }
else if (schema.maxItems!==undefined ) { %>* no more than `<%=schema.maxItems %>` items in the array<% }
else if (schema.minItems!==undefined ) { %>* at least `<%=schema.minItems %>` items in the array<% } %>
<% } %><% if (schema.default!==undefined) { %>
* default: `<%- JSON.stringify(schema.default) %>`
<% } %>
* defined in <% if (schema.$oSchema) { %>[<%= schema.$oSchema.$linkVal %>](<%= schema.$oSchema.$linkPath %>#<%= nameSlug %>)<% } else { %>this schema<% } %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment