-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't trigger
url
remote document load if urls
is provided (…
…via #5161) * fix: don't trigger `url` remote document load if `urls` is provided * better test block title
- Loading branch information
Showing
5 changed files
with
464 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
test/e2e-cypress/static/pages/5138/api-with-examples.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
openapi: "3.0.0" | ||
info: | ||
title: Simple API overview | ||
version: 2.0.0 | ||
paths: | ||
/: | ||
get: | ||
operationId: listVersionsv2 | ||
summary: List API versions | ||
responses: | ||
'200': | ||
description: |- | ||
200 response | ||
content: | ||
application/json: | ||
examples: | ||
foo: | ||
value: { | ||
"versions": [ | ||
{ | ||
"status": "CURRENT", | ||
"updated": "2011-01-21T11:33:21Z", | ||
"id": "v2.0", | ||
"links": [ | ||
{ | ||
"href": "http://127.0.0.1:8774/v2/", | ||
"rel": "self" | ||
} | ||
] | ||
}, | ||
{ | ||
"status": "EXPERIMENTAL", | ||
"updated": "2013-07-23T11:33:21Z", | ||
"id": "v3.0", | ||
"links": [ | ||
{ | ||
"href": "http://127.0.0.1:8774/v3/", | ||
"rel": "self" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
'300': | ||
description: |- | ||
300 response | ||
content: | ||
application/json: | ||
examples: | ||
foo: | ||
value: | | ||
{ | ||
"versions": [ | ||
{ | ||
"status": "CURRENT", | ||
"updated": "2011-01-21T11:33:21Z", | ||
"id": "v2.0", | ||
"links": [ | ||
{ | ||
"href": "http://127.0.0.1:8774/v2/", | ||
"rel": "self" | ||
} | ||
] | ||
}, | ||
{ | ||
"status": "EXPERIMENTAL", | ||
"updated": "2013-07-23T11:33:21Z", | ||
"id": "v3.0", | ||
"links": [ | ||
{ | ||
"href": "http://127.0.0.1:8774/v3/", | ||
"rel": "self" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
/v2: | ||
get: | ||
operationId: getVersionDetailsv2 | ||
summary: Show API version details | ||
responses: | ||
'200': | ||
description: |- | ||
200 response | ||
content: | ||
application/json: | ||
examples: | ||
foo: | ||
value: { | ||
"version": { | ||
"status": "CURRENT", | ||
"updated": "2011-01-21T11:33:21Z", | ||
"media-types": [ | ||
{ | ||
"base": "application/xml", | ||
"type": "application/vnd.openstack.compute+xml;version=2" | ||
}, | ||
{ | ||
"base": "application/json", | ||
"type": "application/vnd.openstack.compute+json;version=2" | ||
} | ||
], | ||
"id": "v2.0", | ||
"links": [ | ||
{ | ||
"href": "http://127.0.0.1:8774/v2/", | ||
"rel": "self" | ||
}, | ||
{ | ||
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf", | ||
"type": "application/pdf", | ||
"rel": "describedby" | ||
}, | ||
{ | ||
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", | ||
"type": "application/vnd.sun.wadl+xml", | ||
"rel": "describedby" | ||
}, | ||
{ | ||
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", | ||
"type": "application/vnd.sun.wadl+xml", | ||
"rel": "describedby" | ||
} | ||
] | ||
} | ||
} | ||
'203': | ||
description: |- | ||
203 response | ||
content: | ||
application/json: | ||
examples: | ||
foo: | ||
value: { | ||
"version": { | ||
"status": "CURRENT", | ||
"updated": "2011-01-21T11:33:21Z", | ||
"media-types": [ | ||
{ | ||
"base": "application/xml", | ||
"type": "application/vnd.openstack.compute+xml;version=2" | ||
}, | ||
{ | ||
"base": "application/json", | ||
"type": "application/vnd.openstack.compute+json;version=2" | ||
} | ||
], | ||
"id": "v2.0", | ||
"links": [ | ||
{ | ||
"href": "http://23.253.228.211:8774/v2/", | ||
"rel": "self" | ||
}, | ||
{ | ||
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf", | ||
"type": "application/pdf", | ||
"rel": "describedby" | ||
}, | ||
{ | ||
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", | ||
"type": "application/vnd.sun.wadl+xml", | ||
"rel": "describedby" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!-- HTML for dev server --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Swagger UI</title> | ||
<link rel="stylesheet" type="text/css" href="/swagger-ui.css"> | ||
<style> | ||
html { | ||
box-sizing: border-box; | ||
overflow: -moz-scrollbars-vertical; | ||
overflow-y: scroll; | ||
} | ||
|
||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: inherit; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
background: #fafafa; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="swagger-ui"></div> | ||
|
||
<script src="/swagger-ui-bundle.js"> </script> | ||
<script src="/swagger-ui-standalone-preset.js"> </script> | ||
<script> | ||
window.onload = function () { | ||
window["SwaggerUIBundle"] = window["swagger-ui-bundle"] | ||
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"] | ||
// Build a system | ||
const ui = SwaggerUIBundle({ | ||
url: "https://petstore.swagger.io/v2/swagger.json", | ||
urls: [ | ||
{ | ||
name: "USPTO", | ||
url: "./uspto.yaml" | ||
}, | ||
{ | ||
name: "Examples", | ||
url: "./api-with-examples.yaml" | ||
}, | ||
], | ||
dom_id: '#swagger-ui', | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIStandalonePreset | ||
], | ||
plugins: [ | ||
SwaggerUIBundle.plugins.DownloadUrl | ||
], | ||
layout: "StandaloneLayout", | ||
onComplete: () => { | ||
if (window.completeCount) { | ||
window.completeCount++ | ||
} else { | ||
window.completeCount = 1 | ||
} | ||
} | ||
}) | ||
|
||
window.ui = ui | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.