MCPcopy
hub / github.com/swagger-api/swagger-ui / render

Method render

src/core/components/info.jsx:60–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 }
59
60 render() {
61 const {
62 info,
63 url,
64 host,
65 basePath,
66 getComponent,
67 externalDocs,
68 selectedServer,
69 url: specUrl,
70 } = this.props
71 const version = info.get("version")
72 const description = info.get("description")
73 const title = info.get("title")
74 const termsOfServiceUrl = safeBuildUrl(
75 info.get("termsOfService"),
76 specUrl,
77 { selectedServer }
78 )
79 const contactData = info.get("contact")
80 const licenseData = info.get("license")
81 const rawExternalDocsUrl = externalDocs && externalDocs.get("url")
82 const externalDocsUrl = safeBuildUrl(rawExternalDocsUrl, specUrl, {
83 selectedServer,
84 })
85 const externalDocsDescription =
86 externalDocs && externalDocs.get("description")
87
88 const Markdown = getComponent("Markdown", true)
89 const Link = getComponent("Link")
90 const VersionStamp = getComponent("VersionStamp")
91 const OpenAPIVersion = getComponent("OpenAPIVersion")
92 const InfoUrl = getComponent("InfoUrl")
93 const InfoBasePath = getComponent("InfoBasePath")
94 const License = getComponent("License")
95 const Contact = getComponent("Contact")
96
97 return (
98 <div className="info">
99 <hgroup className="main">
100 <h1 className="title">
101 {title}
102 <span>
103 {version && <VersionStamp version={version} />}
104 <OpenAPIVersion oasVersion="2.0" />
105 </span>
106 </h1>
107 {host || basePath ? (
108 <InfoBasePath host={host} basePath={basePath} />
109 ) : null}
110 {url && <InfoUrl getComponent={getComponent} url={url} />}
111 </hgroup>
112
113 <div className="description">
114 <Markdown source={description} />
115 </div>
116
117 {termsOfServiceUrl && (

Callers

nothing calls this directly

Calls 4

safeBuildUrlFunction · 0.90
sanitizeUrlFunction · 0.90
getComponentFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected