Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion demo/apis.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"demo-api/demo-api.raml": "RAML 1.0",
"raml-types/raml-types.raml": "RAML 1.0",
"google-drive-api/google-drive-api.raml": "RAML 1.0",
"oas-3-api/oas-3-api.yaml": { "type": "OAS 3.0", "mime": "application/yaml" }
"oas-3-api/oas-3-api.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
"steveTest-1/stevetest.json": { "type": "OAS 2.0", "mime": "application/json" }
}
12 changes: 8 additions & 4 deletions demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ApiDemo extends ApiDemoPage {
this.payloads = this.hasData ? payloads : undefined;
if (this.hasData) {
setTimeout(() => {
// eslint-disable-next-line no-shadow
const list = document.body.querySelector('#mediaList');
if (list) {
list.selected = 0;
Expand All @@ -69,6 +70,7 @@ class ApiDemo extends ApiDemoPage {
if (!(payloads instanceof Array)) {
payloads = [payloads];
}
// eslint-disable-next-line consistent-return
return payloads;
}

Expand All @@ -83,13 +85,14 @@ class ApiDemo extends ApiDemoPage {
result.push({label});
}
});
// eslint-disable-next-line consistent-return
return result.length ? result : undefined;
}

_mediaChanged(e) {
this.hasExamples = false;
const index = e.detail.value;
if (isNaN(index) || index === -1) {
if (Number.isNaN(index) || index === -1) {
return;
}
const mediaType = this.mediaTypes[index].label;
Expand All @@ -103,6 +106,7 @@ class ApiDemo extends ApiDemoPage {
const result = [];

[
['stevetest', 'Stevetest'],
['demo-api', 'Demo API'],
['google-drive-api', 'Google Drive'],
['raml-types', 'RAML types with raml examples'],
Expand All @@ -115,7 +119,7 @@ class ApiDemo extends ApiDemoPage {
}

_examplesTemplate() {
const hasExamples = this.hasExamples;
const {hasExamples} = this;
return hasExamples ?
html`<api-resource-example-document
.amf="${this.amf}"
Expand All @@ -125,8 +129,8 @@ class ApiDemo extends ApiDemoPage {
}

contentTemplate() {
const mediaTypes = this.mediaTypes;
const hasData = this.hasData;
const {mediaTypes} = this;
const {hasData} = this;
return html`
<anypoint-dropdown-menu ?hidden="${this.singlePayload}">
<label slot="label">Select media type</label>
Expand Down
43 changes: 43 additions & 0 deletions demo/steveTest-1/schemas/schema-termsConditionsAccept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"id": "http://example.com/example.json",
"type": "object",
"required": [
"logonID",
"site",
"siteRole",
"acceptedDate"
],
"properties": {
"logonID": {
"id": "#/properties/logonID",
"type": "string",
"description": "OneAmerica user's application logonID.",
"example": "indybrad"
},
"site": {
"id": "#/properties/site",
"type": "string",
"description": "OneAmerica web application identifier within which user is accepting terms.",
"example": "ACCTSERV"
},
"siteRole": {
"id": "#/properties/siteRole",
"type": "string",
"description": "OneAmerica user's role within the web application.",
"example": "PARTCPNT"
},
"impersonationID": {
"id": "#/properties/impersonationID",
"type": "string",
"description": "OneAmerica user account that is accepting on behalf of the actual OneAmerica user.",
"example": "xyz123"
},
"acceptedDate": {
"id": "#/properties/acceptedDate",
"type": "string",
"description": "Datetime of acceptance of terms by the OneAmerica user.",
"example": "2018-01-01T12:00:00.000"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"id": "http://example.com/example.json",
"type": "object",
"default": {},
"additionalProperties": true,
"properties": {
"logonID": {
"id": "#/properties/logonID",
"type": "string",
"description": "OneAmerica user's application logonID."
},
"accepted": {
"id": "#/properties/accepted",
"type": "boolean",
"description": "True/False indicator on whether legal terms were accepted."
},
"acceptedDate": {
"id": "#/properties/acceptedDate",
"type": "string",
"description": "Date of acceptance of legal terms."
}
}
}
167 changes: 167 additions & 0 deletions demo/steveTest-1/stevetest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"swagger": "2.0",
"info": {
"title": "Legal System Service v1",
"description": "This is the suite of Participant Legal services.",
"version": "1.0.0",
"termsOfService": "http://www.oneamerica.com",
"contact": {
"email": "jedimaster@oneamerica.com"
},
"license": {
"name": "OneAmerica 1.0"
}
},
"host": "esb.oneamerica.com:61006",
"basePath": "/api",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
{
"name": "test",
"description": "test"
}
],
"parameters": {
"trait:content-type-required:content-type": {
"required": true,
"type": "string",
"in": "header",
"name": "content-type"
}
},
"paths": {
"/legal/termsConditionsAcceptReset": {
"delete": {
"description": "Delete participants existing terms and conditions",
"responses": {
"200": {
"description": "This status code will be returned when request passes"
},
"400": {
"$ref": "traits/response-errors.json#/responses/400"
},
"404": {
"$ref": "traits/response-errors.json#/responses/404"
},
"405": {
"$ref": "traits/response-errors.json#/responses/405"
},
"406": {
"$ref": "traits/response-errors.json#/responses/406"
},
"415": {
"$ref": "traits/response-errors.json#/responses/406"
},
"500": {
"$ref": "traits/response-errors.json#/responses/500"
},
"501": {
"$ref": "traits/response-errors.json#/responses/501"
}
}
}
},
"/legal/termsConditionsAccept": {
"get": {
"description": "Retrieves a user's status on terms and conditions acceptance.",
"responses": {
"200": {
"description": "This status code will be returned when request passes.",
"schema": {
"$ref": "schemas_response/schema-termsConditionsAccept-Get.json"
},
"examples": {
"application/json": {
"logonID": "indybrad",
"accepted" : true,
"acceptedDate" : "2018-01-01T12:00:00.000"
}
}
},
"400": {
"$ref": "traits/response-errors.json#/responses/400"
},
"404": {
"$ref": "traits/response-errors.json#/responses/404"
},
"405": {
"$ref": "traits/response-errors.json#/responses/405"
},
"406": {
"$ref": "traits/response-errors.json#/responses/406"
},
"415": {
"$ref": "traits/response-errors.json#/responses/406"
},
"500": {
"$ref": "traits/response-errors.json#/responses/500"
},
"501": {
"$ref": "traits/response-errors.json#/responses/501"
}
},
"parameters": [
{
"required": true,
"type": "string",
"in": "header",
"name": "webLogonID"
},
{
"$ref": "#/parameters/trait:content-type-required:content-type"
}
]
},
"post": {
"description": "Store participant's terms and conditions acceptance.",
"responses": {
"200": {
"description": "This status code will be returned when request passes."
},
"400": {
"$ref": "traits/response-errors.json#/responses/400"
},
"404": {
"$ref": "traits/response-errors.json#/responses/404"
},
"405": {
"$ref": "traits/response-errors.json#/responses/405"
},
"406": {
"$ref": "traits/response-errors.json#/responses/406"
},
"415": {
"$ref": "traits/response-errors.json#/responses/406"
},
"500": {
"$ref": "traits/response-errors.json#/responses/500"
},
"501": {
"$ref": "traits/response-errors.json#/responses/501"
}
},
"parameters": [
{
"$ref": "#/parameters/trait:content-type-required:content-type"
},
{
"in": "body",
"name": "body",
"schema": {
"$ref": "schemas/schema-termsConditionsAccept.json"
},
"required": true
}
]
}
}
}
}
Loading