diff --git a/lib/components/RequestSamples/request-samples.html b/lib/components/RequestSamples/request-samples.html index d1175c8c..cc9bbb45 100644 --- a/lib/components/RequestSamples/request-samples.html +++ b/lib/components/RequestSamples/request-samples.html @@ -1,8 +1,8 @@
Request samples
- + - +

diff --git a/lib/components/SchemaSample/schema-sample.ts b/lib/components/SchemaSample/schema-sample.ts
index 39318d40..0347be94 100644
--- a/lib/components/SchemaSample/schema-sample.ts
+++ b/lib/components/SchemaSample/schema-sample.ts
@@ -1,6 +1,6 @@
 'use strict';
 
-import { ElementRef } from '@angular/core';
+import { ElementRef, Input } from '@angular/core';
 
 import * as OpenAPISampler from 'openapi-sampler';
 
@@ -16,6 +16,7 @@ import { JsonFormatter } from '../../utils/JsonFormatterPipe';
 export class SchemaSample extends BaseComponent {
   element: any;
   data: any;
+  @Input() skipReadOnly:boolean;
   constructor(schemaMgr:SchemaManager, elementRef:ElementRef) {
     super(schemaMgr);
     this.element = elementRef.nativeElement;
@@ -38,7 +39,9 @@ export class SchemaSample extends BaseComponent {
     } else {
       this.dereference(this.componentSchema);
       try {
-        sample = OpenAPISampler.sample(this.componentSchema);
+        sample = OpenAPISampler.sample(this.componentSchema, {
+          skipReadOnly: this.skipReadOnly
+        });
       } catch(e) {
         // no sample available
       }
diff --git a/package.json b/package.json
index 31c876b6..1911f0da 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
       "json-pointer": "npm:json-pointer@^0.3.0",
       "json-schema-ref-parser": "npm:json-schema-ref-parser@^3.1.2",
       "marked": "npm:marked@^0.3.5",
-      "openapi-sampler": "npm:openapi-sampler@^0.1.2",
+      "openapi-sampler": "npm:openapi-sampler@0.2.0",
       "prismjs": "npm:prismjs@^1.3.0",
       "rxjs": "npm:rxjs@5.0.0-beta.6",
       "scrollparent": "npm:scrollparent@^0.1.0",
@@ -60,7 +60,7 @@
       "systemjs/plugin-json": "github:systemjs/plugin-json@^0.1.0"
     },
     "overrides": {
-      "npm:openapi-sampler@0.1.2": {
+      "npm:openapi-sampler@0.2.0": {
         "main": "src/openapi-sampler",
         "format": "esm"
       },
@@ -123,7 +123,7 @@
     "karma-sinon": "^1.0.4",
     "marked": "^0.3.5",
     "node-sass": "^3.7.0",
-    "openapi-sampler": "^0.1.2",
+    "openapi-sampler": "^0.2.0",
     "phantomjs-prebuilt": "^2.1.7",
     "protractor": "^3.0.0",
     "reflect-metadata": "^0.1.2",
diff --git a/system.config.js b/system.config.js
index 4b250928..0fe298f5 100644
--- a/system.config.js
+++ b/system.config.js
@@ -34,7 +34,7 @@ System.config({
     "json-pointer": "npm:json-pointer@0.3.0",
     "json-schema-ref-parser": "npm:json-schema-ref-parser@3.1.2",
     "marked": "npm:marked@0.3.5",
-    "openapi-sampler": "npm:openapi-sampler@0.1.2",
+    "openapi-sampler": "npm:openapi-sampler@0.2.0",
     "prismjs": "npm:prismjs@1.3.0",
     "rxjs": "npm:rxjs@5.0.0-beta.6",
     "scrollparent": "npm:scrollparent@0.1.0",
@@ -641,7 +641,7 @@ System.config({
       "process": "github:jspm/nodelibs-process@0.1.2",
       "util": "github:jspm/nodelibs-util@0.1.0"
     },
-    "npm:openapi-sampler@0.1.2": {
+    "npm:openapi-sampler@0.2.0": {
       "process": "github:jspm/nodelibs-process@0.1.2"
     },
     "npm:os-browserify@0.1.2": {
diff --git a/typings/openapi-sampler.d.ts b/typings/openapi-sampler.d.ts
index 8c2101de..46fe48b9 100644
--- a/typings/openapi-sampler.d.ts
+++ b/typings/openapi-sampler.d.ts
@@ -1,3 +1,3 @@
 declare module "openapi-sampler" {
-  export function sample(schema:any):any;
+  export function sample(schema:any, options?:any):any;
 }