expandDepth } collapsedContent={ collapsedContent }>
{ braceOpen }
{
- !isRef ? null :
+ !isRef ? null :
}
{
@@ -94,6 +95,7 @@ export default class ObjectModel extends Component {
@@ -132,6 +134,7 @@ export default class ObjectModel extends Component {
|
@@ -146,6 +149,7 @@ export default class ObjectModel extends Component {
{anyOf.map((schema, k) => {
return
@@ -161,6 +165,7 @@ export default class ObjectModel extends Component {
{oneOf.map((schema, k) => {
return
@@ -177,6 +182,7 @@ export default class ObjectModel extends Component {
diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx
index ea1877f3028..1369411ac0c 100644
--- a/src/core/components/operation.jsx
+++ b/src/core/components/operation.jsx
@@ -6,6 +6,7 @@ import { Iterable } from "immutable"
export default class Operation extends PureComponent {
static propTypes = {
+ specPath: PropTypes.array.isRequired,
operation: PropTypes.instanceOf(Iterable).isRequired,
response: PropTypes.instanceOf(Iterable),
request: PropTypes.instanceOf(Iterable),
@@ -36,6 +37,7 @@ export default class Operation extends PureComponent {
render() {
let {
+ specPath,
response,
request,
toggleShown,
@@ -57,7 +59,6 @@ export default class Operation extends PureComponent {
let {
isShown,
isAuthorized,
- jumpToKey,
path,
method,
op,
@@ -112,8 +113,10 @@ export default class Operation extends PureComponent {
let onChangeKey = [ path, method ] // Used to add values to _this_ operation ( indexed by path and method )
return (
+
+ {/*TODO: convert this into a component, that can be wrapped
+ and pulled in with getComponent */}
-
{method.toUpperCase()}
{path}
-
+ {/*TODO: use wrapComponents here, swagger-ui doesn't care about jumpToPath */}
{ !showSummary ? null :
@@ -170,6 +173,7 @@ export default class Operation extends PureComponent {
{
const path = op.get("path")
const method = op.get("method")
+ const specPath = ["paths", path, method]
+
// FIXME: (someday) this logic should probably be in a selector,
// but doing so would require further opening up
@@ -134,6 +136,7 @@ export default class Operations extends React.Component {
return {
@@ -58,6 +60,7 @@ export default class Parameters extends Component {
parameters,
allowTryItOut,
tryItOutEnabled,
+ specPath,
fn,
getComponent,
@@ -92,8 +95,10 @@ export default class Parameters extends Component {
{
- eachMap(parameters, (parameter) => (
- (
+
{
responses.entrySeq().map( ([code, response]) => {
+
let className = tryItOutResponse && tryItOutResponse.get("status") == code ? "response_current" : ""
return (
{
const Markdown = getComponent("Markdown")
@@ -37,6 +38,7 @@ const RequestBody = ({
expandDepth={1}
isExecute={isExecute}
schema={mediaTypeValue.get("schema")}
+ specPath={[...specPath, "content", contentType]}
example={
@@ -136,9 +140,10 @@ class Parameters extends Component {
{
- eachMap(parameters, (parameter) => (
+ eachMap(parameters, (parameter, i) => (
{
diff --git a/test/components/models.js b/test/components/models.js
index 750a8cf123b..49eff79463c 100644
--- a/test/components/models.js
+++ b/test/components/models.js
@@ -18,6 +18,7 @@ describe("", function(){
return components[c]
},
specSelectors: {
+ isOAS3: () => false,
definitions: function() {
return fromJS({
def1: {},
diff --git a/test/components/object-model.js b/test/components/object-model.js
index 8c4b9452aa3..640eedf7bfa 100644
--- a/test/components/object-model.js
+++ b/test/components/object-model.js
@@ -25,6 +25,7 @@ describe("", function() {
}
},
isRef : false,
+ specPath: [],
schema: Immutable.fromJS(
{
"properties": {
|