Skip to content

Commit 8633372

Browse files
authored
Merge pull request #3519 from shockey/bug/editor-1418-oas3-jump-to-model
Create valid paths for model jumping in OAS3
2 parents 6233886 + c664e39 commit 8633372

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/components/object-model.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default class ObjectModel extends Component {
1919
render(){
2020
let { schema, name, isRef, getComponent, depth, ...props } = this.props
2121
let { expandDepth, specSelectors } = this.props
22+
let { isOAS3 } = specSelectors
2223
let description = schema.get("description")
2324
let properties = schema.get("properties")
2425
let additionalProperties = schema.get("additionalProperties")
@@ -30,7 +31,10 @@ export default class ObjectModel extends Component {
3031
const Model = getComponent("Model")
3132
const ModelCollapse = getComponent("ModelCollapse")
3233

33-
const JumpToPathSection = ({ name }) => <span className="model-jump-to-path"><JumpToPath path={`definitions.${name}`} /></span>
34+
const JumpToPathSection = ({ name }) => {
35+
const path = isOAS3 && isOAS3() ? `components.schemas.${name}` : `definitions.${name}`
36+
return <span className="model-jump-to-path"><JumpToPath path={path} /></span>
37+
}
3438
const collapsedContent = (<span>
3539
<span>{ braceOpen }</span>...<span>{ braceClose }</span>
3640
{

0 commit comments

Comments
 (0)