layoutActions.show("models", !showModels)}>
@@ -37,7 +38,7 @@ export default class Models extends Component {
@@ -141,7 +142,7 @@ export default class ObjectModel extends Component {
|
@@ -156,7 +157,7 @@ export default class ObjectModel extends Component {
{anyOf.map((schema, k) => {
return
@@ -172,7 +173,7 @@ export default class ObjectModel extends Component {
{oneOf.map((schema, k) => {
return
@@ -189,7 +190,7 @@ export default class ObjectModel extends Component {
diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx
index 7063cf22..c7a6b194 100644
--- a/src/core/components/operation.jsx
+++ b/src/core/components/operation.jsx
@@ -2,11 +2,12 @@ import React, { PureComponent } from "react"
import PropTypes from "prop-types"
import { getList } from "core/utils"
import { getExtensions, sanitizeUrl } from "core/utils"
-import { Iterable } from "immutable"
+import { Iterable, List } from "immutable"
+import ImPropTypes from "react-immutable-proptypes"
export default class Operation extends PureComponent {
static propTypes = {
- specPath: PropTypes.array.isRequired,
+ specPath: ImPropTypes.list.isRequired,
operation: PropTypes.instanceOf(Iterable).isRequired,
response: PropTypes.instanceOf(Iterable),
request: PropTypes.instanceOf(Iterable),
@@ -33,7 +34,7 @@ export default class Operation extends PureComponent {
operation: null,
response: null,
request: null,
- specPath: []
+ specPath: List()
}
render() {
@@ -174,7 +175,7 @@ export default class Operation extends PureComponent {
{
const path = op.get("path")
const method = op.get("method")
- const specPath = ["paths", path, method]
+ const specPath = Im.List(["paths", path, method])
// FIXME: (someday) this logic should probably be in a selector,
diff --git a/src/core/components/parameter-row.jsx b/src/core/components/parameter-row.jsx
index d4792cd7..82b0eee5 100644
--- a/src/core/components/parameter-row.jsx
+++ b/src/core/components/parameter-row.jsx
@@ -1,6 +1,7 @@
import React, { Component } from "react"
import { Map } from "immutable"
import PropTypes from "prop-types"
+import ImPropTypes from "react-immutable-proptypes"
import win from "core/window"
import { getExtensions } from "core/utils"
@@ -15,7 +16,7 @@ export default class ParameterRow extends Component {
specSelectors: PropTypes.object.isRequired,
pathMethod: PropTypes.array.isRequired,
getConfigs: PropTypes.func.isRequired,
- specPath: PropTypes.array.isRequired,
+ specPath: ImPropTypes.list.isRequired
}
constructor(props, context) {
@@ -139,7 +140,7 @@ export default class ParameterRow extends Component {
{
bodyParam && schema ? (
{
@@ -47,7 +48,7 @@ export default class Response extends React.Component {
getComponent: PropTypes.func.isRequired,
getConfigs: PropTypes.func.isRequired,
specSelectors: PropTypes.object.isRequired,
- specPath: PropTypes.array.isRequired,
+ specPath: ImPropTypes.list.isRequired,
fn: PropTypes.object.isRequired,
contentType: PropTypes.string,
controlsAcceptHeader: PropTypes.bool,
@@ -99,7 +100,7 @@ export default class Response extends React.Component {
var schema, specPathWithPossibleSchema
if(isOAS3()) {
- const schemaPath = ["content", this.state.responseContentType, "schema"]
+ const schemaPath = List(["content", this.state.responseContentType, "schema"])
const oas3SchemaForContentType = response.getIn(schemaPath)
sampleResponse = oas3SchemaForContentType ? getSampleSchema(oas3SchemaForContentType.toJS(), this.state.responseContentType, {
includeReadOnly: true
@@ -108,7 +109,7 @@ export default class Response extends React.Component {
specPathWithPossibleSchema = oas3SchemaForContentType ? schemaPath : specPath
} else {
schema = inferSchema(response.toJS()) // TODO: don't convert back and forth. Lets just stick with immutable for inferSchema
- specPathWithPossibleSchema = response.has("schema") ? [...specPath, "schema"] : specPath
+ specPathWithPossibleSchema = response.has("schema") ? specPath.push("schema") : specPath
sampleResponse = schema ? getSampleSchema(schema, contentType, {
includeReadOnly: true,
includeWriteOnly: true // writeOnly has no filtering effect in swagger 2.0
diff --git a/src/core/components/responses.jsx b/src/core/components/responses.jsx
index 43affdcf..397a2c75 100644
--- a/src/core/components/responses.jsx
+++ b/src/core/components/responses.jsx
@@ -1,6 +1,7 @@
import React from "react"
-import PropTypes from "prop-types"
import { fromJS, Iterable } from "immutable"
+import PropTypes from "prop-types"
+import ImPropTypes from "react-immutable-proptypes"
import { defaultStatusCode, getAcceptControllingResponse } from "core/utils"
export default class Responses extends React.Component {
@@ -17,7 +18,7 @@ export default class Responses extends React.Component {
specSelectors: PropTypes.object.isRequired,
specActions: PropTypes.object.isRequired,
oas3Actions: PropTypes.object.isRequired,
- specPath: PropTypes.array.isRequired,
+ specPath: ImPropTypes.list.isRequired,
fn: PropTypes.object.isRequired
}
@@ -120,7 +121,7 @@ export default class Responses extends React.Component {
let className = tryItOutResponse && tryItOutResponse.get("status") == code ? "response_current" : ""
return (
@@ -143,7 +143,7 @@ class Parameters extends Component {
eachMap(parameters, (parameter, i) => (
", function() {
}
},
isRef : false,
- specPath: [],
+ specPath: List(),
schema: Immutable.fromJS(
{
"properties": {
|