1
1
import React , { PureComponent } from 'react'
2
2
import PropTypes from 'prop-types'
3
- import classNames from 'classnames'
4
3
import ScrollableAnchor from 'react-scrollable-anchor'
5
4
import BodyContent from '../BodyContent/BodyContent'
6
5
import Description from '../Description/Description'
7
6
import Parameters from '../Parameters/Parameters'
8
7
import Response from '../Response/Response'
8
+ import MethodEndpoints from './MethodEndpoints'
9
9
import { styles } from './Method.styles'
10
10
11
11
@styles
12
12
export default class Method extends PureComponent {
13
13
render ( ) {
14
- const { method, classes, initialSchemaTreeDepth } = this . props
15
- const { title, type, description, parameters, request, responses } = method
14
+ const { method, classes, initialSchemaTreeDepth} = this . props
15
+ const { title, type, path , endpoints , description, parameters, request, responses} = method
16
16
17
17
return (
18
18
< ScrollableAnchor id = { method . link } >
19
19
< div className = { classes . method } >
20
20
< h3 >
21
21
{ title }
22
- < span className = { classNames ( classes . type , `${ method . type } ` ) } > { type } </ span >
23
22
</ h3 >
23
+ < MethodEndpoints type = { type } path = { path } endpoints = { endpoints } />
24
24
< div >
25
25
{ description && < Description description = { description } /> }
26
26
{ parameters && < Parameters parameters = { parameters } initialSchemaTreeDepth = { initialSchemaTreeDepth } /> }
@@ -33,7 +33,7 @@ export default class Method extends PureComponent {
33
33
}
34
34
35
35
renderRequest ( request , initialSchemaTreeDepth ) {
36
- const { schema, examples } = request
36
+ const { schema, examples} = request
37
37
38
38
if ( ! schema ) {
39
39
return null
@@ -65,7 +65,9 @@ Method.propTypes = {
65
65
description : PropTypes . string ,
66
66
parameters : PropTypes . object ,
67
67
request : PropTypes . object ,
68
- responses : PropTypes . array
68
+ responses : PropTypes . array ,
69
+ path : PropTypes . string ,
70
+ endpoints : PropTypes . array
69
71
} ) ,
70
72
classes : PropTypes . object ,
71
73
initialSchemaTreeDepth : PropTypes . number
0 commit comments