diff --git a/package-lock.json b/package-lock.json index 7f1f36b6939..9693f942a7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "swagger-ui", - "version": "3.19.5", + "version": "3.20.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7269,7 +7269,7 @@ }, "form-data": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", "integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=", "requires": { "async": "^2.0.1", diff --git a/src/core/components/models.jsx b/src/core/components/models.jsx index 98f7351a38e..d23020bbb67 100644 --- a/src/core/components/models.jsx +++ b/src/core/components/models.jsx @@ -37,6 +37,7 @@ export default class Models extends Component { let showModels = layoutSelectors.isShown("models", defaultModelsExpandDepth > 0 && docExpansion !== "none") const specPathBase = this.getSchemaBasePath() + const isOAS3 = specSelectors.isOAS3() const ModelWrapper = getComponent("ModelWrapper") const Collapse = getComponent("Collapse") @@ -45,7 +46,7 @@ export default class Models extends Component { return

layoutActions.show("models", !showModels)}> - Models + {isOAS3 ? "Schemas" : "Models" } diff --git a/test/e2e-cypress/tests/bugs/swos-63.js b/test/e2e-cypress/tests/bugs/swos-63.js new file mode 100644 index 00000000000..e7c6ddef4b9 --- /dev/null +++ b/test/e2e-cypress/tests/bugs/swos-63.js @@ -0,0 +1,14 @@ +describe("SWOS-63: Schema/Model section labeling", () => { + it("should render `Schemas` for OpenAPI 3", () => { + cy + .visit("/?url=/documents/petstore-expanded.openapi.yaml") + .get("section.models > h4") + .contains("Schemas") + }) + it("should render `Models` for OpenAPI 2", () => { + cy + .visit("/?url=/documents/petstore.swagger.yaml") + .get("section.models > h4") + .contains("Models") + }) +})