feat: apply cumulative update to address various issues (#10324)
This commit is contained in:
@@ -2,20 +2,16 @@
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("UI #4442: Parameter.content display and execution", function() {
|
||||
describe("UI #4442: Parameter.content display and execution", function () {
|
||||
it("should display textareas as static documentation according to the `example`", () => {
|
||||
cy.visit("/?url=/documents/bugs/4442.yaml")
|
||||
.get(`#operations-default-get_`)
|
||||
.click()
|
||||
.get(".btn.try-out__btn")
|
||||
.click()
|
||||
.get(
|
||||
`div.json-schema-array > div:nth-child(1) > div > textarea`
|
||||
)
|
||||
.get(`div.json-schema-array > div:nth-child(1) > div > textarea`)
|
||||
.should("have.value", `{\n "userId": 1,\n "currency": "USD"\n}`)
|
||||
.get(
|
||||
`div.json-schema-array > div:nth-child(2) > div > textarea`
|
||||
)
|
||||
.get(`div.json-schema-array > div:nth-child(2) > div > textarea`)
|
||||
.should("have.value", `{\n "userId": 2,\n "currency": "CAD"\n}`)
|
||||
})
|
||||
it("should serialize JSON into a query correctly", () => {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import repeat from "lodash/repeat"
|
||||
|
||||
describe("#4838: empty request bodies result in endless loading", () => {
|
||||
it("should render model content changes correctly", () => {
|
||||
cy
|
||||
@@ -8,4 +6,4 @@ describe("#4838: empty request bodies result in endless loading", () => {
|
||||
.click()
|
||||
.contains("This should be visible")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("#5452: <Select /> crashing in Parameters", function() {
|
||||
describe("#5452: <Select /> crashing in Parameters", function () {
|
||||
describe("in OpenAPI 3", () => {
|
||||
it("should not result in a render error", function() {
|
||||
it("should not result in a render error", function () {
|
||||
cy.visit("http://localhost:3230/?url=/documents/bugs/5452/openapi.yaml")
|
||||
.get("#operations-default-get_endpoint")
|
||||
.click()
|
||||
@@ -20,7 +20,7 @@ describe("#5452: <Select /> crashing in Parameters", function() {
|
||||
})
|
||||
})
|
||||
describe("in Swagger 2", () => {
|
||||
it("should not result in a render error", function() {
|
||||
it("should not result in a render error", function () {
|
||||
cy.visit("http://localhost:3230/?url=/documents/bugs/5452/swagger.yaml")
|
||||
.get("#operations-default-get_endpoint")
|
||||
.click()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import repeat from "lodash/repeat"
|
||||
|
||||
describe("Editor #1868: model changes break rendering", () => {
|
||||
it("should render model content changes correctly", () => {
|
||||
cy
|
||||
@@ -23,4 +21,4 @@ describe("Editor #1868: model changes break rendering", () => {
|
||||
.get("#model-MyModel")
|
||||
.contains("b")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ describe("Deep linking feature", () => {
|
||||
describe("Operation with whitespace in tag+id", () => {
|
||||
const elementToGet = ".opblock-post"
|
||||
const correctFragment = "#/my%20Tag/my%20Operation"
|
||||
|
||||
|
||||
OperationDeeplinkTestFactory({
|
||||
baseUrl: swagger2BaseUrl,
|
||||
elementToGet,
|
||||
@@ -109,7 +109,7 @@ describe("Deep linking feature", () => {
|
||||
describe("Operation with whitespace in tag+id", () => {
|
||||
const elementToGet = ".opblock-post"
|
||||
const correctFragment = "#/my%20Tag/my%20Operation"
|
||||
|
||||
|
||||
OperationDeeplinkTestFactory({
|
||||
baseUrl: openAPI3BaseUrl,
|
||||
elementToGet: ".opblock-post",
|
||||
@@ -117,7 +117,7 @@ describe("Deep linking feature", () => {
|
||||
correctFragment,
|
||||
correctHref: "#/my%20Tag/my%20Operation"
|
||||
})
|
||||
|
||||
|
||||
const legacyFragment = "#/my_Tag/my_Operation"
|
||||
|
||||
it("should expand the operation when reloaded and provided the legacy fragment", () => {
|
||||
@@ -190,7 +190,7 @@ describe("Deep linking feature", () => {
|
||||
})
|
||||
})
|
||||
|
||||
function OperationDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, correctFragment, correctHref }) {
|
||||
function OperationDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, correctFragment, correctHref }) {
|
||||
it("should generate a correct element ID", () => {
|
||||
cy.visit(baseUrl)
|
||||
.get(elementToGet)
|
||||
@@ -245,7 +245,7 @@ function OperationDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId,
|
||||
})
|
||||
}
|
||||
|
||||
function TagDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, correctFragment, correctHref, isTagCase = false }) {
|
||||
function TagDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, correctFragment, correctHref }) {
|
||||
it("should generate a correct element ID", () => {
|
||||
cy.visit(baseUrl)
|
||||
.get(elementToGet)
|
||||
@@ -289,4 +289,4 @@ function TagDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, corre
|
||||
.get(`.opblock-tag-section.is-open`)
|
||||
.should("have.length", 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.get(".info__extdocs")
|
||||
.should("exist")
|
||||
.and("contain.text", "Read external docs")
|
||||
.and("have.attr", "href", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
|
||||
it("should display link to external docs without description", () => {
|
||||
@@ -32,7 +32,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.get(".info__extdocs")
|
||||
.should("exist")
|
||||
.and("contain.text", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -43,7 +43,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.should("exist")
|
||||
.find("a")
|
||||
.should("contain.text", "Pet Documentation")
|
||||
.and("have.attr", "href", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
|
||||
it("should display link to external docs without description", () => {
|
||||
@@ -52,7 +52,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.should("exist")
|
||||
.find("a")
|
||||
.should("contain.text", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -65,7 +65,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.click()
|
||||
.get(`.models #model-${type} .external-docs a`)
|
||||
.should("contain.text", `${type} Docs`)
|
||||
.and("have.attr", "href", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
|
||||
it("should display link without description", () => {
|
||||
@@ -74,7 +74,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.click()
|
||||
.get(`.models #model-${type}WithoutDescription .external-docs a`)
|
||||
.should("contain.text", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io")
|
||||
.and("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.get("#operations-pet-updatePet .opblock-external-docs-wrapper .opblock-external-docs__description")
|
||||
.should("contain.text", "More details about putting a pet")
|
||||
.get("#operations-pet-updatePet .opblock-external-docs-wrapper .opblock-external-docs__link")
|
||||
.should("have.attr", "href", "http://swagger.io")
|
||||
.should("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
|
||||
it("should display link to external docs without description", () => {
|
||||
@@ -102,7 +102,7 @@ function ExternalDocsTest(baseUrl) {
|
||||
.get("#operations-pet-addPet .opblock-external-docs-wrapper .opblock-external-docs__description")
|
||||
.should("not.exist")
|
||||
.get("#operations-pet-addPet .opblock-external-docs-wrapper .opblock-external-docs__link")
|
||||
.should("have.attr", "href", "http://swagger.io")
|
||||
.should("have.attr", "href", "http://swagger.io/")
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ describe("Model collapse/expand feature", () => {
|
||||
})
|
||||
})
|
||||
|
||||
function ModelCollapseTest(baseUrl, urlFragment) {
|
||||
function ModelCollapseTest(baseUrl) {
|
||||
it("Models section should be expanded on load", () => {
|
||||
cy.visit(baseUrl)
|
||||
.get(".models")
|
||||
|
||||
@@ -617,7 +617,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.click()
|
||||
// Set an invalid value
|
||||
.get(
|
||||
".parameters-container > div > table > tbody > tr > td.parameters-col_description > div:nth-child(2) > textarea"
|
||||
".parameters-container > div > table > tbody > tr > td.parameters-col_description > div:nth-child(2) textarea"
|
||||
)
|
||||
.type("{{{{ [[[[ <<<< invalid JSON here.")
|
||||
// Execute the operation
|
||||
|
||||
43
test/e2e-cypress/e2e/features/oas3-extension.cy.js
Normal file
43
test/e2e-cypress/e2e/features/oas3-extension.cy.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("OpenAPI 3.0 extensions", () => {
|
||||
describe("displays extensions", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-extension.yaml&showExtensions=true"
|
||||
)
|
||||
|
||||
cy.get(".model-box-control").contains("User").click()
|
||||
cy.get(".property-row").contains("[...]").click()
|
||||
})
|
||||
|
||||
it("object extensions are visible", () => {
|
||||
cy.get(".extension").contains(`x-object-extension`).should("be.visible")
|
||||
cy.get(".extension")
|
||||
.contains(`x-object-objectExtension`)
|
||||
.should("be.visible")
|
||||
})
|
||||
|
||||
it("primitive extensions are visible", () => {
|
||||
cy.get(".extension")
|
||||
.contains(`x-primitive-extension`)
|
||||
.should("be.visible")
|
||||
cy.get(".extension")
|
||||
.contains(`x-primitive-objectExtension`)
|
||||
.should("be.visible")
|
||||
})
|
||||
})
|
||||
|
||||
it("should hide extensions if showExtensions option is set to false", () => {
|
||||
cy.visit("/?url=/documents/features/oas3-extension.yaml")
|
||||
cy.get(".model-box-control").contains("User").click()
|
||||
cy.get(".property-row").contains("[...]").click()
|
||||
|
||||
cy.contains("x-primitive-extension").should("not.exist")
|
||||
cy.contains("x-primitive-objectExtension").should("not.exist")
|
||||
cy.contains("x-object-extension").should("not.exist")
|
||||
cy.contains("x-object-objectExtension").should("not.exist")
|
||||
})
|
||||
})
|
||||
@@ -4,9 +4,7 @@
|
||||
|
||||
describe("OpenAPI 3.0 Multiple Servers", () => {
|
||||
it("should render and execute for server '/test-url-1'", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-multiple-servers.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml")
|
||||
.get(".scheme-container .schemes .servers label > select")
|
||||
.select("/test-url-1")
|
||||
.get("#operations-default-get_")
|
||||
@@ -21,9 +19,7 @@ describe("OpenAPI 3.0 Multiple Servers", () => {
|
||||
.should("contains.text", "/test-url-1")
|
||||
})
|
||||
it("should render and execute for server '/test-url-2'", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-multiple-servers.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml")
|
||||
.get(".scheme-container .schemes .servers label > select")
|
||||
.select("/test-url-2")
|
||||
.get("#operations-default-get_")
|
||||
@@ -38,9 +34,7 @@ describe("OpenAPI 3.0 Multiple Servers", () => {
|
||||
.should("contains.text", "/test-url-2")
|
||||
})
|
||||
it("should render and execute for server '/test-url-1' after sequence: select '/test-url-2' -> Try-It-Out -> select '/test-url-1'", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-multiple-servers.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml")
|
||||
.get(".scheme-container .schemes .servers label > select")
|
||||
.select("/test-url-2")
|
||||
.get("#operations-default-get_")
|
||||
@@ -58,14 +52,10 @@ describe("OpenAPI 3.0 Multiple Servers", () => {
|
||||
.should("contains.text", "/test-url-1")
|
||||
})
|
||||
it("should render and execute for server '/test-url-switch-1' after changing api definition", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-multiple-servers.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml")
|
||||
.get(".scheme-container .schemes .servers label > select")
|
||||
.select("/test-url-2")
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-multiple-servers-switch.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/oas3-multiple-servers-switch.yaml")
|
||||
.get(".scheme-container .schemes .servers label > select")
|
||||
.select("/test-url-switch-2")
|
||||
.get("#operations-default-get_")
|
||||
|
||||
@@ -4,79 +4,99 @@
|
||||
|
||||
describe("OpenAPI 3.0 Allow Empty Values in Request Body", () => {
|
||||
it("should not apply or render to required fields", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/petstore-only-pet.openapi.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml")
|
||||
.get("#operations-pet-addPet")
|
||||
.click()
|
||||
.get(".opblock-section .opblock-section-request-body .body-param-content-type > select")
|
||||
.get(
|
||||
".opblock-section .opblock-section-request-body .body-param-content-type > select"
|
||||
)
|
||||
.select("application/x-www-form-urlencoded")
|
||||
// Expand Try It Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
// Request Body
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.should("not.exist")
|
||||
})
|
||||
|
||||
it("by default, should be checked for all non-required fields", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/petstore-only-pet.openapi.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml")
|
||||
.get("#operations-pet-addPet")
|
||||
.click()
|
||||
.get(".opblock-section .opblock-section-request-body .body-param-content-type > select")
|
||||
.get(
|
||||
".opblock-section .opblock-section-request-body .body-param-content-type > select"
|
||||
)
|
||||
.select("application/x-www-form-urlencoded")
|
||||
// Expand Try It Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
// Request Body
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove"
|
||||
)
|
||||
.click()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.should("be.checked")
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select"
|
||||
)
|
||||
.select("--")
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.should("be.checked")
|
||||
})
|
||||
|
||||
it("checkbox should be toggle-able", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/petstore-only-pet.openapi.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml")
|
||||
.get("#operations-pet-addPet")
|
||||
.click()
|
||||
.get(".opblock-section .opblock-section-request-body .body-param-content-type > select")
|
||||
.get(
|
||||
".opblock-section .opblock-section-request-body .body-param-content-type > select"
|
||||
)
|
||||
.select("application/x-www-form-urlencoded")
|
||||
// Expand Try It Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
// Request Body
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove"
|
||||
)
|
||||
.click()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.should("be.checked")
|
||||
.uncheck()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.should("not.be.checked")
|
||||
})
|
||||
|
||||
it("on execute, should allow send with all empty values", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/petstore-only-pet.openapi.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml")
|
||||
.get("#operations-pet-addPet")
|
||||
.click()
|
||||
.get(".opblock-section .opblock-section-request-body .body-param-content-type > select")
|
||||
.get(
|
||||
".opblock-section .opblock-section-request-body .body-param-content-type > select"
|
||||
)
|
||||
.select("application/x-www-form-urlencoded")
|
||||
// Expand Try It Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
// Remove example values
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove"
|
||||
)
|
||||
.click()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select"
|
||||
)
|
||||
.select("--")
|
||||
// Execute
|
||||
.get(".execute.opblock-control__btn")
|
||||
@@ -89,23 +109,29 @@ describe("OpenAPI 3.0 Allow Empty Values in Request Body", () => {
|
||||
})
|
||||
|
||||
it("on execute, should allow send with some empty values", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/petstore-only-pet.openapi.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml")
|
||||
.get("#operations-pet-addPet")
|
||||
.click()
|
||||
.get(".opblock-section .opblock-section-request-body .body-param-content-type > select")
|
||||
.get(
|
||||
".opblock-section .opblock-section-request-body .body-param-content-type > select"
|
||||
)
|
||||
.select("application/x-www-form-urlencoded")
|
||||
// Expand Try It Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
// Request Body
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove"
|
||||
)
|
||||
.click()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.uncheck()
|
||||
// add item to pass required validation
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(4) input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(4) input"
|
||||
)
|
||||
.clear()
|
||||
// Execute
|
||||
.get(".execute.opblock-control__btn")
|
||||
@@ -119,24 +145,32 @@ describe("OpenAPI 3.0 Allow Empty Values in Request Body", () => {
|
||||
})
|
||||
|
||||
it("on execute, should allow send with skip all empty values", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/petstore-only-pet.openapi.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml")
|
||||
.get("#operations-pet-addPet")
|
||||
.click()
|
||||
.get(".opblock-section .opblock-section-request-body .body-param-content-type > select")
|
||||
.get(
|
||||
".opblock-section .opblock-section-request-body .body-param-content-type > select"
|
||||
)
|
||||
.select("application/x-www-form-urlencoded")
|
||||
// Expand Try It Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
// Request Body
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove"
|
||||
)
|
||||
.click()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.uncheck()
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select"
|
||||
)
|
||||
.select("--")
|
||||
.get(".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description .parameter__empty_value_toggle input")
|
||||
.get(
|
||||
".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description .parameter__empty_value_toggle input"
|
||||
)
|
||||
.uncheck()
|
||||
// Execute
|
||||
.get(".execute.opblock-control__btn")
|
||||
@@ -148,5 +182,4 @@ describe("OpenAPI 3.0 Allow Empty Values in Request Body", () => {
|
||||
.should("not.contains.text", "tags=")
|
||||
.should("not.contains.text", "status=")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
78
test/e2e-cypress/e2e/features/oas31-extension.cy.js
Normal file
78
test/e2e-cypress/e2e/features/oas31-extension.cy.js
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
const showsExtensions = (keyword) => {
|
||||
it("extensions are visible on keyword click", () => {
|
||||
cy.get(".json-schema-2020-12-json-viewer__name")
|
||||
.contains("x-primitiveExtension")
|
||||
.should("not.be.visible")
|
||||
cy.get(".json-schema-2020-12-json-viewer__name")
|
||||
.contains("x-arrayExtension")
|
||||
.should("not.be.visible")
|
||||
cy.get(".json-schema-2020-12-json-viewer__name")
|
||||
.contains("x-objectExtension")
|
||||
.should("not.be.visible")
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword__name").contains(keyword).click()
|
||||
|
||||
cy.get(".json-schema-2020-12-json-viewer__name")
|
||||
.contains("x-primitiveExtension")
|
||||
.should("be.visible")
|
||||
cy.get(".json-schema-2020-12-json-viewer__name")
|
||||
.contains("x-arrayExtension")
|
||||
.should("be.visible")
|
||||
cy.get(".json-schema-2020-12-json-viewer__name")
|
||||
.contains("x-objectExtension")
|
||||
.should("be.visible")
|
||||
})
|
||||
}
|
||||
|
||||
describe("OpenAPI 3.1 extension keyword", () => {
|
||||
describe("displays extensions", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas31-extension.yaml&showExtensions=true"
|
||||
)
|
||||
})
|
||||
|
||||
describe("Discriminator extension", () => {
|
||||
beforeEach(() => {
|
||||
cy.get(".json-schema-2020-12").contains("My Pet").click()
|
||||
})
|
||||
showsExtensions("Discriminator")
|
||||
})
|
||||
|
||||
describe("External documentation extension", () => {
|
||||
beforeEach(() => {
|
||||
cy.get(".json-schema-2020-12").contains("Object").click()
|
||||
})
|
||||
showsExtensions("External documentation")
|
||||
})
|
||||
|
||||
describe("XML extension", () => {
|
||||
beforeEach(() => {
|
||||
cy.get(".json-schema-2020-12").contains("Book").click()
|
||||
})
|
||||
showsExtensions("XML")
|
||||
})
|
||||
})
|
||||
|
||||
it("should hide extensions if showExtensions option is set to false", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas31-extension.yaml&showExtensions=false"
|
||||
)
|
||||
cy.get(".json-schema-2020-12").contains("Object").click()
|
||||
cy.get(".json-schema-2020-12-keyword__name")
|
||||
.contains("External documentation")
|
||||
.click()
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword__name--secondary")
|
||||
.contains("url")
|
||||
.should("be.visible")
|
||||
|
||||
cy.contains("x-primitiveExtension").should("not.exist")
|
||||
cy.contains("x-arrayExtension").should("not.exist")
|
||||
cy.contains("x-objectExtension").should("not.exist")
|
||||
})
|
||||
})
|
||||
41
test/e2e-cypress/e2e/features/parameter-schema.cy.js
Normal file
41
test/e2e-cypress/e2e/features/parameter-schema.cy.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("Operation parameters", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("/?url=/documents/features/parameter-schema.yaml")
|
||||
})
|
||||
|
||||
it("should render example for parameters of type object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/object").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for parameters of type object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/object").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .model").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for parameters of type array of objects", () => {
|
||||
cy.visit("/?url=/documents/features/parameter-schema.yaml")
|
||||
|
||||
cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for parameters of type array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .model").should("exist")
|
||||
})
|
||||
})
|
||||
@@ -21,7 +21,7 @@ describe("Parameter with oneOf and anyOf keywords in OpenAPI 3.0.x", () => {
|
||||
.eq(3)
|
||||
.find("textarea")
|
||||
.should("exist")
|
||||
.and("contain", "\"eq\": \"active\"")
|
||||
.and("contain", '"eq": "active"')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -44,6 +44,6 @@ describe("Parameter with oneOf and anyOf keywords in OpenAPI 3.1.0.", () => {
|
||||
.eq(3)
|
||||
.find("textarea")
|
||||
.should("exist")
|
||||
.and("contain", "\"eq\": \"active\"")
|
||||
.and("contain", '"eq": "active"')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
describe("JSON Schema 2020-12 examples keyword", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("/?url=/documents/features/json-schema-2020-12-examples.yaml")
|
||||
})
|
||||
|
||||
it("should render `Examples` section", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.get(".json-schema-2020-12-keyword--examples").should("exist")
|
||||
})
|
||||
|
||||
it("should render primitive examples value", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Examples").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--examples")
|
||||
.contains("#0")
|
||||
.as("primitiveExample")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@primitiveExample")
|
||||
.siblings(".json-schema-2020-12-json-viewer__value")
|
||||
.contains("1")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("should render array examples value", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Examples").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--examples")
|
||||
.contains("#1")
|
||||
.as("arrayExample")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@arrayExample").click()
|
||||
|
||||
cy.get("@arrayExample")
|
||||
.parent()
|
||||
.contains("#0")
|
||||
.as("arrayExampleItem")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@arrayExampleItem")
|
||||
.siblings(".json-schema-2020-12-json-viewer__value")
|
||||
.contains("2")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("should render object examples values", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Examples").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--examples")
|
||||
.contains("#2")
|
||||
.as("objectExample")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@objectExample").click()
|
||||
|
||||
cy.get("@objectExample")
|
||||
.parent()
|
||||
.contains("prop")
|
||||
.as("objectExampleProperty")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@objectExampleProperty")
|
||||
.siblings(".json-schema-2020-12-json-viewer__value")
|
||||
.contains("3")
|
||||
.should("exist")
|
||||
})
|
||||
})
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
describe("JSON Schema 2020-12 complex keywords expansion", () => {
|
||||
it("should deeply expand all Schemas and complex keywords", () => {
|
||||
cy.visit("/pages/json-schema-2020-12-expansion/").then(
|
||||
() => {
|
||||
cy.get(".json-schema-2020-12-accordion")
|
||||
.find(".json-schema-2020-12-accordion__icon--collapsed")
|
||||
.should("not.exist")
|
||||
cy.contains("anyOf1-p1-p2-p1").should("exist")
|
||||
cy.contains("oneOf1-p1-p2-p1").should("exist")
|
||||
cy.contains("Prefix items").should("exist")
|
||||
cy.contains("exampleDef").should("exist")
|
||||
cy.contains("https://json-schema.org/draft/2020-12/vocab/core").should("exist")
|
||||
}
|
||||
)
|
||||
cy.visit("/pages/json-schema-2020-12-expansion/").then(() => {
|
||||
cy.get(".json-schema-2020-12-accordion")
|
||||
.find(".json-schema-2020-12-accordion__icon--collapsed")
|
||||
.should("not.exist")
|
||||
cy.contains("anyOf1-p1-p2-p1").should("exist")
|
||||
cy.contains("oneOf1-p1-p2-p1").should("exist")
|
||||
cy.contains("Prefix items").should("exist")
|
||||
cy.contains("exampleDef").should("exist")
|
||||
cy.contains("https://json-schema.org/draft/2020-12/vocab/core").should(
|
||||
"exist"
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("JSON Schema 2020-12 extension keywords", () => {
|
||||
describe("display extension keywords", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/json-schema-2020-12-extension-keywords.yaml&showExtensions=true"
|
||||
)
|
||||
})
|
||||
|
||||
it("should render `Extension Keywords` section", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.get(".json-schema-2020-12-keyword--extension-keywords").should("exist")
|
||||
})
|
||||
|
||||
it("should render extension keywords with primitive values", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Extension Keywords").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-json-viewer-extension-keyword")
|
||||
.contains("primitiveExtension")
|
||||
.as("primitiveExtension")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@primitiveExtension")
|
||||
.siblings(".json-schema-2020-12-json-viewer__value")
|
||||
.contains("1")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("should render extension keywords with array values", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Extension Keywords").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-json-viewer-extension-keyword")
|
||||
.contains("arrayExtension")
|
||||
.should("exist")
|
||||
|
||||
cy.contains("arrayExtension").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-json-viewer__children")
|
||||
.contains("#0")
|
||||
.as("arrayExtensionItem")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@arrayExtensionItem")
|
||||
.siblings(".json-schema-2020-12-json-viewer__value")
|
||||
.contains("2")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("should render extension keywords with object values", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Extension Keywords").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-json-viewer-extension-keyword")
|
||||
.contains("objectExtension")
|
||||
.should("exist")
|
||||
|
||||
cy.contains("objectExtension").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-json-viewer__children")
|
||||
.contains("prop")
|
||||
.as("objectExtensionProperty")
|
||||
.should("exist")
|
||||
|
||||
cy.get("@objectExtensionProperty")
|
||||
.siblings(".json-schema-2020-12-json-viewer__value")
|
||||
.contains("3")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("should not render OpenAPI 3.1.0 keywords as extension keywords", () => {
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Extension Keywords").click()
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--extension-keywords")
|
||||
.children()
|
||||
.contains("Default")
|
||||
.should("not.exist")
|
||||
})
|
||||
})
|
||||
|
||||
it("shouldn't display extensions when showExtensions option is set to false", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/json-schema-2020-12-extension-keywords.yaml"
|
||||
)
|
||||
|
||||
cy.get(".json-schema-2020-12-accordion").click()
|
||||
cy.contains("Extension Keywords").should("not.exist")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("JSON Schema 2020-12 uniqueItems keyword", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("/?url=/documents/features/json-schema-2020-12-unique-items.yaml")
|
||||
})
|
||||
|
||||
it("should render `unique` label", () => {
|
||||
cy.contains("UniqueItems")
|
||||
.siblings("span")
|
||||
.contains("unique")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("should render `unique items` label with range constraints", () => {
|
||||
cy.contains("UniqueItemsAndRangeConstraint")
|
||||
.siblings("span")
|
||||
.contains("[1, 5] unique items")
|
||||
.should("exist")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("Request body with complex schema properties", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas3-request-body-complex-schema-properties.yaml"
|
||||
)
|
||||
})
|
||||
|
||||
it("should render example for properties of type object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/object").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for properties of type object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/object").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .model").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for properties of type array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for properties of type array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .model").should("exist")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("Operation parameters with schema and union type", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("/?url=/documents/features/oas31-parameter-schema.yaml")
|
||||
})
|
||||
|
||||
it("should render example for parameters with union type including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click()
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for parameters with union type including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for parameters with union type including array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and(
|
||||
"have.value",
|
||||
'[\n {\n "id": "string",\n "name": "string"\n }\n]'
|
||||
)
|
||||
})
|
||||
|
||||
it("should render schema for parameters with union type including array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for parameters of type array with union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for parameters of type array with union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for parameters with union type including array and union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span")
|
||||
.contains("/arrayTypeAndItemTypeUnion")
|
||||
.click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and(
|
||||
"have.value",
|
||||
'[\n {\n "id": "string",\n "name": "string"\n }\n]'
|
||||
)
|
||||
})
|
||||
|
||||
it("should render example for parameters with union type including array and union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span")
|
||||
.contains("/arrayTypeAndItemTypeUnion")
|
||||
.click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("Request body properties with schema and union type", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas31-request-body-complex-schema-properties.yaml"
|
||||
)
|
||||
})
|
||||
|
||||
it("should render example for properties with union type including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for properties with union type including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for properties with union type including array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and(
|
||||
"have.value",
|
||||
'[\n {\n "id": "string",\n "name": "string"\n }\n]'
|
||||
)
|
||||
})
|
||||
|
||||
it("should render schema for properties with union type including array of objects", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for properties of type array with union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and("have.value", '{\n "id": "string",\n "name": "string"\n}')
|
||||
})
|
||||
|
||||
it("should render schema for properties of type array with union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
|
||||
it("should render example for properties with union type including array and union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span")
|
||||
.contains("/arrayTypeAndItemTypeUnion")
|
||||
.click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example textarea")
|
||||
.should("exist")
|
||||
.and(
|
||||
"have.value",
|
||||
'[\n {\n "id": "string",\n "name": "string"\n }\n]'
|
||||
)
|
||||
})
|
||||
|
||||
it("should render example for properties with union type including array and union type of items including object", () => {
|
||||
cy.get(".opblock-summary-path span")
|
||||
.contains("/arrayTypeAndItemTypeUnion")
|
||||
.click()
|
||||
cy.get("button").contains("Try it out").click()
|
||||
|
||||
cy.get(".model-example button").contains("Schema").click()
|
||||
cy.get(".model-example .json-schema-2020-12").should("exist")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("OpenAPI 3.1.0 schema expansion", () => {
|
||||
it("should expand to the default expansion level", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas31-schema-expansion.yaml&defaultModelsExpandDepth=3&showExtensions=true"
|
||||
)
|
||||
|
||||
cy.get(".json-schema-2020-12-property").contains("prop2").should("exist")
|
||||
cy.get(".json-schema-2020-12-property")
|
||||
.contains("prop3")
|
||||
.should("not.exist")
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--xml")
|
||||
.contains("x-extension")
|
||||
.should("exist")
|
||||
cy.get(".json-schema-2020-12-keyword--xml")
|
||||
.contains("prop1")
|
||||
.should("not.exist")
|
||||
})
|
||||
|
||||
it("should deeply expand nested collapsed keywords", () => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/oas31-schema-expansion.yaml&showExtensions=true"
|
||||
)
|
||||
|
||||
cy.get(".json-schema-2020-12-expand-deep-button").click()
|
||||
cy.get(".json-schema-2020-12-keyword--xml")
|
||||
.contains("prop4")
|
||||
.should("exist")
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--xml").contains("prop1").click()
|
||||
cy.get(".json-schema-2020-12-keyword--xml")
|
||||
.contains("prop4")
|
||||
.should("not.exist")
|
||||
|
||||
cy.get(".json-schema-2020-12-keyword--xml").contains("XML").click()
|
||||
cy.get(
|
||||
".json-schema-2020-12-keyword--xml .json-schema-2020-12-expand-deep-button"
|
||||
)
|
||||
.first()
|
||||
.click()
|
||||
cy.get(".json-schema-2020-12-keyword--xml")
|
||||
.contains("prop4")
|
||||
.should("exist")
|
||||
})
|
||||
})
|
||||
@@ -9,7 +9,10 @@ describe("OpenAPI 3.0 Request Body upload file button", () => {
|
||||
.get("#operations-default-uploadApplicationOctetStream")
|
||||
.click()
|
||||
.get(".opblock-section-request-body .opblock-description-wrapper i")
|
||||
.should("have.text", "Example values are not available for application/octet-stream media types.")
|
||||
.should(
|
||||
"have.text",
|
||||
"Example values are not available for application/octet-stream media types."
|
||||
)
|
||||
})
|
||||
it("should display a file upload button", () => {
|
||||
cy.visit("/?url=/documents/features/request-body-upload-file.yaml")
|
||||
@@ -27,7 +30,10 @@ describe("OpenAPI 3.0 Request Body upload file button", () => {
|
||||
.get("#operations-default-uploadImagePng")
|
||||
.click()
|
||||
.get(".opblock-section-request-body .opblock-description-wrapper i")
|
||||
.should("have.text", "Example values are not available for image/png media types.")
|
||||
.should(
|
||||
"have.text",
|
||||
"Example values are not available for image/png media types."
|
||||
)
|
||||
})
|
||||
it("should display a file upload button", () => {
|
||||
cy.visit("/?url=/documents/features/request-body-upload-file.yaml")
|
||||
@@ -45,7 +51,10 @@ describe("OpenAPI 3.0 Request Body upload file button", () => {
|
||||
.get("#operations-default-uploadAudioWav")
|
||||
.click()
|
||||
.get(".opblock-section-request-body .opblock-description-wrapper i")
|
||||
.should("have.text", "Example values are not available for audio/wav media types.")
|
||||
.should(
|
||||
"have.text",
|
||||
"Example values are not available for audio/wav media types."
|
||||
)
|
||||
})
|
||||
it("should display a file upload button", () => {
|
||||
cy.visit("/?url=/documents/features/request-body-upload-file.yaml")
|
||||
@@ -63,7 +72,10 @@ describe("OpenAPI 3.0 Request Body upload file button", () => {
|
||||
.get("#operations-default-uploadVideoMpeg")
|
||||
.click()
|
||||
.get(".opblock-section-request-body .opblock-description-wrapper i")
|
||||
.should("have.text", "Example values are not available for video/mpeg media types.")
|
||||
.should(
|
||||
"have.text",
|
||||
"Example values are not available for video/mpeg media types."
|
||||
)
|
||||
})
|
||||
it("should display a file upload button", () => {
|
||||
cy.visit("/?url=/documents/features/request-body-upload-file.yaml")
|
||||
@@ -81,7 +93,10 @@ describe("OpenAPI 3.0 Request Body upload file button", () => {
|
||||
.get("#operations-default-uploadSchemaFormatBinary")
|
||||
.click()
|
||||
.get(".opblock-section-request-body .opblock-description-wrapper i")
|
||||
.should("have.text", "Example values are not available for application/x-custom media types.")
|
||||
.should(
|
||||
"have.text",
|
||||
"Example values are not available for application/x-custom media types."
|
||||
)
|
||||
})
|
||||
it("should display a file upload button", () => {
|
||||
cy.visit("/?url=/documents/features/request-body-upload-file.yaml")
|
||||
@@ -99,7 +114,10 @@ describe("OpenAPI 3.0 Request Body upload file button", () => {
|
||||
.get("#operations-default-uploadSchemaFormatBase64")
|
||||
.click()
|
||||
.get(".opblock-section-request-body .opblock-description-wrapper i")
|
||||
.should("have.text", "Example values are not available for application/x-custom media types.")
|
||||
.should(
|
||||
"have.text",
|
||||
"Example values are not available for application/x-custom media types."
|
||||
)
|
||||
})
|
||||
it("should display a file upload button", () => {
|
||||
cy.visit("/?url=/documents/features/request-body-upload-file.yaml")
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
|
||||
describe("JSON Schema Form: Enum & Boolean in a Parameter", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(
|
||||
"/?url=/documents/features/schema-form-enum-boolean.yaml"
|
||||
)
|
||||
cy.visit("/?url=/documents/features/schema-form-enum-boolean.yaml")
|
||||
.get("#operations-pet-findPetsByStatus")
|
||||
.click()
|
||||
// Expand Try It Out
|
||||
@@ -47,56 +45,37 @@ describe("JSON Schema Form: Enum & Boolean in a Parameter", () => {
|
||||
})
|
||||
it("should NOT be able to execute with empty @enumIsRequired and @booleanIsRequired values", () => {
|
||||
// Execute
|
||||
cy.get("@executeBtn")
|
||||
.click()
|
||||
cy.get("@enumIsRequired")
|
||||
.should("have.class", "invalid")
|
||||
cy.get("@booleanIsRequired")
|
||||
.should("have.class", "invalid")
|
||||
cy.get("@executeBtn").click()
|
||||
cy.get("@enumIsRequired").should("have.class", "invalid")
|
||||
cy.get("@booleanIsRequired").should("have.class", "invalid")
|
||||
// cURL component
|
||||
cy.get(".responses-wrapper .curl-command")
|
||||
.should("not.exist")
|
||||
cy.get(".responses-wrapper .curl-command").should("not.exist")
|
||||
})
|
||||
it("should NOT be able to execute with empty @booleanIsRequired value, but valid @enumIsRequired", () => {
|
||||
cy.get("@enumIsRequired")
|
||||
.select("pending")
|
||||
cy.get("@enumIsRequired").select("pending")
|
||||
// Execute
|
||||
cy.get("@executeBtn")
|
||||
.click()
|
||||
cy.get("@enumIsRequired")
|
||||
.should("not.have.class", "invalid")
|
||||
cy.get("@booleanIsRequired")
|
||||
.should("have.class", "invalid")
|
||||
cy.get("@executeBtn").click()
|
||||
cy.get("@enumIsRequired").should("not.have.class", "invalid")
|
||||
cy.get("@booleanIsRequired").should("have.class", "invalid")
|
||||
// cURL component
|
||||
cy.get(".responses-wrapper .curl-command")
|
||||
.should("not.exist")
|
||||
cy.get(".responses-wrapper .curl-command").should("not.exist")
|
||||
})
|
||||
it("should NOT be able to execute with empty @enumIsRequired value, but valid @booleanIsRequired", () => {
|
||||
cy.get("@booleanIsRequired")
|
||||
.select("false")
|
||||
cy.get("@booleanIsRequired").select("false")
|
||||
// Execute
|
||||
cy.get("@executeBtn")
|
||||
.click()
|
||||
cy.get("@enumIsRequired")
|
||||
.should("have.class", "invalid")
|
||||
cy.get("@booleanIsRequired")
|
||||
.should("not.have.class", "invalid")
|
||||
cy.get("@executeBtn").click()
|
||||
cy.get("@enumIsRequired").should("have.class", "invalid")
|
||||
cy.get("@booleanIsRequired").should("not.have.class", "invalid")
|
||||
// cURL component
|
||||
cy.get(".responses-wrapper .curl-command")
|
||||
.should("not.exist")
|
||||
cy.get(".responses-wrapper .curl-command").should("not.exist")
|
||||
})
|
||||
it("should execute, if @booleanIsOptional value is 'false'", () => {
|
||||
cy.get("@enumIsRequired")
|
||||
.select("pending")
|
||||
cy.get("@booleanIsRequired")
|
||||
.select("false")
|
||||
cy.get("@booleanIsOptional")
|
||||
.select("false")
|
||||
cy.get("@enumIsRequired").select("pending")
|
||||
cy.get("@booleanIsRequired").select("false")
|
||||
cy.get("@booleanIsOptional").select("false")
|
||||
// Execute
|
||||
cy.get("@executeBtn")
|
||||
.click()
|
||||
cy.get("@enumIsRequired")
|
||||
.should("not.have.class", "invalid")
|
||||
cy.get("@executeBtn").click()
|
||||
cy.get("@enumIsRequired").should("not.have.class", "invalid")
|
||||
cy.get("@booleanIsRequired")
|
||||
.should("not.have.class", "invalid")
|
||||
.should("not.contains.text", "expectIsOptional")
|
||||
@@ -107,15 +86,11 @@ describe("JSON Schema Form: Enum & Boolean in a Parameter", () => {
|
||||
.should("contains.text", "expectIsOptional=false")
|
||||
})
|
||||
it("should execute, but NOT send @booleanIsOptional value if not provided", () => {
|
||||
cy.get("@enumIsRequired")
|
||||
.select("pending")
|
||||
cy.get("@booleanIsRequired")
|
||||
.select("false")
|
||||
cy.get("@enumIsRequired").select("pending")
|
||||
cy.get("@booleanIsRequired").select("false")
|
||||
// Execute
|
||||
cy.get("@executeBtn")
|
||||
.click()
|
||||
cy.get("@enumIsRequired")
|
||||
.should("not.have.class", "invalid")
|
||||
cy.get("@executeBtn").click()
|
||||
cy.get("@enumIsRequired").should("not.have.class", "invalid")
|
||||
cy.get("@booleanIsRequired")
|
||||
.should("not.have.class", "invalid")
|
||||
.should("not.contains.text", "expectIsOptional")
|
||||
@@ -125,5 +100,4 @@ describe("JSON Schema Form: Enum & Boolean in a Parameter", () => {
|
||||
.get(".responses-wrapper .curl-command span")
|
||||
.should("not.contains.text", "expectIsOptional")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -9,9 +9,9 @@ describe("Parse YAML as YAML@1.2 with json_schema for all JSON-supported types",
|
||||
.click()
|
||||
// Responses -> example value tab
|
||||
.get(".language-json > :nth-child(3)")
|
||||
.should("have.text", "\"without-quotes\"")
|
||||
.should("have.text", '"without-quotes"')
|
||||
.get(".language-json > :nth-child(5)")
|
||||
.should("have.text", "\"1999-11-31\"")
|
||||
.should("have.text", '"1999-11-31"')
|
||||
// Responses -> schema tab
|
||||
.get(".model-example > .tab > :nth-child(2)")
|
||||
.click()
|
||||
|
||||
@@ -8,17 +8,17 @@ describe("Syntax Highlighting for JSON value cases", () => {
|
||||
describe("OAS 2", () => {
|
||||
it("should render full syntax highlighted string in Request (param body) example", () => {
|
||||
cy.visit("/?url=/documents/features/syntax-highlighting-json-oas2.yaml")
|
||||
.get("#operations-default-post_setServices")
|
||||
.click()
|
||||
.get(".body-param__example > .language-json > :nth-child(10)")
|
||||
.should("have.text", "\"79daf5b4-aa4b-1452-eae5-42c231477ba7\"")
|
||||
.get("#operations-default-post_setServices")
|
||||
.click()
|
||||
.get(".body-param__example > .language-json > :nth-child(10)")
|
||||
.should("have.text", '"79daf5b4-aa4b-1452-eae5-42c231477ba7"')
|
||||
})
|
||||
it("should render full syntax highlighted string in Response example", () => {
|
||||
cy.visit("/?url=/documents/features/syntax-highlighting-json-oas2.yaml")
|
||||
.get("#operations-default-post_setServices")
|
||||
.click()
|
||||
.get(".example > .language-json > :nth-child(28)")
|
||||
.should("have.text", "\"5ff06f632bb165394501b05d3a833355\"")
|
||||
.get("#operations-default-post_setServices")
|
||||
.click()
|
||||
.get(".example > .language-json > :nth-child(28)")
|
||||
.should("have.text", '"5ff06f632bb165394501b05d3a833355"')
|
||||
})
|
||||
})
|
||||
describe("OAS 3", () => {
|
||||
@@ -27,14 +27,14 @@ describe("Syntax Highlighting for JSON value cases", () => {
|
||||
.get("#operations-default-post_setServices")
|
||||
.click()
|
||||
.get(".body-param__example > .language-json > :nth-child(15)")
|
||||
.should("have.text", "\"22a124b4-594b-4452-bdf5-fc3ef1477ba7\"")
|
||||
.should("have.text", '"22a124b4-594b-4452-bdf5-fc3ef1477ba7"')
|
||||
})
|
||||
it("should render full syntax highlighted string in Response example", () => {
|
||||
cy.visit("/?url=/documents/features/syntax-highlighting-json-oas3.yaml")
|
||||
.get("#operations-default-post_setServices")
|
||||
.click()
|
||||
.get(".example > .language-json > :nth-child(33)")
|
||||
.should("have.text", "\"f0009babde9dbe204540d79cf754408e\"")
|
||||
.should("have.text", '"f0009babde9dbe204540d79cf754408e"')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ describe("XSS: OAuth2 authorizationUrl sanitization", () => {
|
||||
.window()
|
||||
.then(win => {
|
||||
let args = null
|
||||
const stub = cy.stub(win, "open", (...callArgs) => {
|
||||
cy.stub(win, "open", (...callArgs) => {
|
||||
args = callArgs
|
||||
}).as("windowOpen")
|
||||
|
||||
@@ -15,7 +15,7 @@ describe("XSS: OAuth2 authorizationUrl sanitization", () => {
|
||||
.wait(100)
|
||||
.then(() => {
|
||||
console.log(args)
|
||||
expect(args[0]).to.match(/^about:blank/)
|
||||
expect(args[0]).to.match(/^about:blank/)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
|
||||
paths:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Demo API
|
||||
description: First test
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
paths:
|
||||
/some/route:
|
||||
@@ -9,4 +9,4 @@ paths:
|
||||
requestBody: {}
|
||||
responses:
|
||||
'200':
|
||||
description: Description
|
||||
description: Description
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: test
|
||||
version: "0.1"
|
||||
@@ -21,4 +21,4 @@ paths:
|
||||
type: string
|
||||
responses:
|
||||
default:
|
||||
description: ok
|
||||
description: ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
description: Test API
|
||||
version: v1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
info:
|
||||
description: "A sample API for "
|
||||
version: "1.0.0"
|
||||
@@ -32,4 +32,4 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
type: object
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
info:
|
||||
description: "A sample API for "
|
||||
version: "1.0.0"
|
||||
@@ -23,11 +23,11 @@ paths:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
type: object
|
||||
responses:
|
||||
'200':
|
||||
description: Status message
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
type: object
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
paths:
|
||||
/aev:
|
||||
get:
|
||||
parameters:
|
||||
parameters:
|
||||
- name: param
|
||||
in: query
|
||||
allowEmptyValue: true
|
||||
@@ -23,4 +23,4 @@ paths:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
description: ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
paths:
|
||||
/:
|
||||
@@ -20,4 +20,4 @@ paths:
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- "hi"
|
||||
- "hi"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
info:
|
||||
title: Required parameter missing, doesn't block request from executing.
|
||||
version: '1'
|
||||
openapi: 3.0.0
|
||||
servers:
|
||||
openapi: 3.0.4
|
||||
servers:
|
||||
- url: http://httpbin.org/anything
|
||||
paths:
|
||||
/foos:
|
||||
@@ -24,4 +24,4 @@ paths:
|
||||
required: true # Note this doesn't have an impact
|
||||
responses:
|
||||
default:
|
||||
description: ok
|
||||
description: ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
servers: []
|
||||
info:
|
||||
description: sdf
|
||||
@@ -9,8 +9,8 @@ paths:
|
||||
get:
|
||||
tags:
|
||||
- default
|
||||
summary:
|
||||
whatever: 123
|
||||
summary:
|
||||
whatever: 123
|
||||
operationId: objectSummary
|
||||
responses:
|
||||
'405':
|
||||
@@ -21,4 +21,4 @@ paths:
|
||||
operationId: noSummary
|
||||
responses:
|
||||
'405':
|
||||
description: Invalid input
|
||||
description: Invalid input
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
info:
|
||||
title: Testcase API
|
||||
version: 2.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Response without a schema
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: test
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: test
|
||||
description: Nullable model itself
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: test
|
||||
description: Nullable object in model property
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: OAS 3.0 sample with entries as property name
|
||||
version: 0.1.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "Swagger Test"
|
||||
version: "1.0.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: OAS 3.0 sample with multiple servers
|
||||
version: 0.1.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "OAS 3.0 sample with Object Model deprecated: true"
|
||||
version: 0.1.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "OAS 3.0 sample with Object Model deprecated: true"
|
||||
version: 0.1.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Example Swagger
|
||||
version: '1.0'
|
||||
@@ -22,7 +22,7 @@ paths:
|
||||
properties:
|
||||
x:
|
||||
type: string
|
||||
example:
|
||||
example:
|
||||
x: what the f
|
||||
examples:
|
||||
x2:
|
||||
@@ -46,7 +46,7 @@ paths:
|
||||
properties:
|
||||
x:
|
||||
type: string
|
||||
example:
|
||||
example:
|
||||
x: what the f
|
||||
example:
|
||||
x: should be xml
|
||||
x: should be xml
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Example Swagger
|
||||
version: '1.0'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
description: Test API
|
||||
version: v1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: XML array schema with array-level example
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "This is an example highlighting a display issue related to `tags` and `description` entries therein. It contains tag descriptions with & without externalDocs."
|
||||
version: 1.0.0
|
||||
@@ -25,4 +25,4 @@ paths:
|
||||
- "bar"
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
description: OK
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Example Swagger with required default body parameter
|
||||
version: 1.0.0
|
||||
@@ -25,4 +25,4 @@ components:
|
||||
properties:
|
||||
bodyParameter:
|
||||
type: string
|
||||
default: default
|
||||
default: default
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Bearer auth test
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
|
||||
info:
|
||||
version: "1.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
paths:
|
||||
/:
|
||||
@@ -9,7 +9,7 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
@@ -21,7 +21,7 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
@@ -41,7 +41,7 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
@@ -52,7 +52,7 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
type: object
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
|
||||
info:
|
||||
title: External Docs
|
||||
version: "1"
|
||||
|
||||
|
||||
externalDocs:
|
||||
description: Read external docs
|
||||
url: http://swagger.io
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
openapi: 3.1.0
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
examples:
|
||||
- 1
|
||||
- - 2
|
||||
- prop: 3
|
||||
@@ -0,0 +1,10 @@
|
||||
openapi: 3.1.0
|
||||
components:
|
||||
schemas:
|
||||
ExtensionKeywords:
|
||||
primitiveExtension: 1
|
||||
arrayExtension:
|
||||
- 2
|
||||
objectExtension:
|
||||
prop: 3
|
||||
default: default value
|
||||
@@ -0,0 +1,9 @@
|
||||
openapi: 3.1.0
|
||||
components:
|
||||
schemas:
|
||||
UniqueItems:
|
||||
uniqueItems: true
|
||||
UniqueItemsAndRangeConstraint:
|
||||
uniqueItems: true
|
||||
minItems: 1
|
||||
maxItems: 5
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: OpenAPI 3.0 License with only url present
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
components:
|
||||
schemas:
|
||||
@@ -28,7 +28,7 @@ components:
|
||||
type: boolean
|
||||
default: false
|
||||
xml:
|
||||
name: Order
|
||||
name: Order
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
@@ -52,7 +52,7 @@ components:
|
||||
format: int32
|
||||
description: User Status
|
||||
xml:
|
||||
name: User
|
||||
name: User
|
||||
Pet:
|
||||
type: object
|
||||
required:
|
||||
@@ -90,4 +90,3 @@ components:
|
||||
- sold
|
||||
xml:
|
||||
name: Pet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "Multiple Examples: Core Document"
|
||||
description: |
|
||||
@@ -82,7 +82,7 @@ paths:
|
||||
$ref: '#/components/examples/StringExampleC'
|
||||
/Number:
|
||||
post:
|
||||
parameters:
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
@@ -142,7 +142,7 @@ paths:
|
||||
$ref: '#/components/examples/NumberExampleC'
|
||||
/Boolean:
|
||||
post:
|
||||
parameters:
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
@@ -194,7 +194,7 @@ paths:
|
||||
$ref: '#/components/examples/BooleanExampleB'
|
||||
/Array:
|
||||
post:
|
||||
parameters:
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
@@ -239,7 +239,7 @@ paths:
|
||||
$ref: '#/components/examples/ArrayExampleC'
|
||||
/Object:
|
||||
post:
|
||||
parameters:
|
||||
parameters:
|
||||
- in: query
|
||||
name: data
|
||||
required: true
|
||||
@@ -296,11 +296,11 @@ components:
|
||||
summary: Don't just string me along...
|
||||
description: |
|
||||
A string in C is actually a character array. As an individual character variable can store only one character, we need an array of characters to store strings. Thus, in C string is stored in an array of characters. Each character in a string occupies one location in an array. The null character ‘\0’ is put after the last character. This is done so that program can tell when the end of the string has been reached.
|
||||
|
||||
For example, the string “Hello” is stored as follows...
|
||||
|
||||
|
||||
For example, the string “Hello” is stored as follows...
|
||||
|
||||

|
||||
|
||||
|
||||
Since the string contains 5 characters. it requires a character array of size 6 to store it. the last character in a string is always a NULL('\0') character. Always keep in mind that the '\0' is not included in the length if the string, so here the length of the string is 5 only. Notice above that the indexes of the string starts from 0 not one so don't confuse yourself with index and length of string.
|
||||
|
||||
Thus, in C, a string is a one-dimensional array of characters terminated a null character. The terminating null character is important. In fact, a string not terminated by ‘\0’ is not really a string, but merely a collection of characters.
|
||||
@@ -311,11 +311,11 @@ components:
|
||||
A pangram (Greek: παν γράμμα, pan gramma, "every letter") or holoalphabetic sentence is a sentence using every letter of a given alphabet at least once. Pangrams have been used to display typefaces, test equipment, and develop skills in handwriting, calligraphy, and keyboarding.
|
||||
|
||||
The best-known English pangram is "The quick brown fox jumps over the lazy dog". It has been used since at least the late 19th century, was utilized by Western Union to test Telex / TWX data communication equipment for accuracy and reliability, and is now used by a number of computer programs (most notably the font viewer built into Microsoft Windows) to display computer fonts.
|
||||
|
||||
|
||||
Pangrams exist in practically every alphabet-based language. An example from German is _Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich_, which contains all letters, including every umlaut (ä, ö, ü) plus the ß. It has been used since before 1800.
|
||||
|
||||
|
||||
In a sense, the pangram is the opposite of the lipogram, in which the aim is to omit one or more letters.
|
||||
|
||||
|
||||
A perfect pangram contains every letter of the alphabet only once and
|
||||
can be considered an anagram of the alphabet. The only perfect pangrams
|
||||
that are known either use abbreviations, such as "Mr Jock, TV quiz PhD,
|
||||
@@ -331,18 +331,18 @@ components:
|
||||
summary: "World population"
|
||||
description: |
|
||||
In demographics, the world population is the total number of humans currently living, and was estimated to have reached 7.7 billion people as of April 2019. It took over 200,000 years of human history for the world's population to reach 1 billion; and only 200 years more to reach 7 billion.
|
||||
|
||||
|
||||
World population has experienced continuous growth since the end of the Great Famine of 1315–1317 and the Black Death in 1350, when it was near 370 million. The highest population growth rates – global population increases above 1.8% per year – occurred between 1955 and 1975, peaking to 2.1% between 1965 and 1970. The growth rate has declined to 1.2% between 2010 and 2015 and is projected to decline further in the course of the 21st century. However, the global population is still growing and is projected to reach about 10 billion in 2050 and more than 11 billion in 2100.
|
||||
|
||||
|
||||
Total annual births were highest in the late 1980s at about 139 million, and as of 2011 were expected to remain essentially constant at a level of 135 million, while deaths numbered 56 million per year and were expected to increase to 80 million per year by 2040. The median age of the world's population was estimated to be 30.4 years in 2018.
|
||||
NumberExampleB:
|
||||
value: 9007199254740991
|
||||
summary: "Number.MAX_SAFE_INTEGER"
|
||||
description: |
|
||||
The `MAX_SAFE_INTEGER` constant has a value of `9007199254740991` (9,007,199,254,740,991 or ~9 quadrillion). The reasoning behind that number is that JavaScript uses double-precision floating-point format numbers as specified in IEEE 754 and can only safely represent numbers between `-(2^53 - 1)` and `2^53 - 1`.
|
||||
|
||||
|
||||
Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to `true`, which is mathematically incorrect. See `Number.isSafeInteger()` for more information.
|
||||
|
||||
|
||||
Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a `Number` object you created.
|
||||
NumberExampleC:
|
||||
# `description` and `summary` intentionally omitted
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Test
|
||||
description: 'Test'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
servers: []
|
||||
info:
|
||||
version: "1.0.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"openapi": "3.0.2",
|
||||
"openapi": "3.0.4",
|
||||
"info": {
|
||||
"title": "Clinical Study",
|
||||
"description": "The Clinical Study interface enables an external system to read study data and demand forecast data, add a study entity, and submit the results of enrollment forecast calculations.",
|
||||
@@ -62958,4 +62958,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "Swagger Test"
|
||||
version: "1.0.0"
|
||||
servers:
|
||||
- url: https://api.example.com/v1
|
||||
components:
|
||||
schemas:
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
readOnly: true
|
||||
x-primitive-extension: test
|
||||
x-primitive-objectExtension:
|
||||
prop:
|
||||
test: test,
|
||||
nested:
|
||||
test: test,
|
||||
nested:
|
||||
test: test
|
||||
x-object-extension: 1
|
||||
x-object-objectExtension:
|
||||
prop:
|
||||
test: test,
|
||||
nested:
|
||||
test: test,
|
||||
nested:
|
||||
test: test
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Switching between multiple content-type test
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
servers:
|
||||
- url: /test-url-switch-1
|
||||
- url: /test-url-switch-2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
servers:
|
||||
- url: /test-url-1
|
||||
- url: /test-url-2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.3
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Example app
|
||||
description: This is my test applicaiton
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Request Body Example
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/object:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
object:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayOfObjects:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
arrayOfObjects:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"openapi": "3.0.4",
|
||||
"info": {
|
||||
"version": "1.0.0",
|
||||
"title": "XML definition with oneOf & anyOf",
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Test
|
||||
description: 'Test'
|
||||
license:
|
||||
name: 'Apache 2.0'
|
||||
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
|
||||
version: '1.0'
|
||||
servers:
|
||||
- url: http://petstore.swagger.io/v1
|
||||
components:
|
||||
schemas:
|
||||
Pet:
|
||||
title: My Pet
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
discriminator:
|
||||
propertyName: id
|
||||
mapping:
|
||||
x-primitiveExtension: 1
|
||||
x-arrayExtension:
|
||||
- 2
|
||||
x-objectExtension:
|
||||
prop: 3
|
||||
default: default value
|
||||
Object:
|
||||
type: object
|
||||
externalDocs:
|
||||
description: Object Docs
|
||||
url: http://swagger.io
|
||||
x-primitiveExtension: 1
|
||||
x-arrayExtension:
|
||||
- 2
|
||||
x-objectExtension:
|
||||
prop: 3
|
||||
default: default value
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
Book:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
title:
|
||||
type: string
|
||||
author:
|
||||
type: string
|
||||
xml:
|
||||
prefix: "smp"
|
||||
namespace: "http://example.com/schema"
|
||||
x-primitiveExtension: 1
|
||||
x-arrayExtension:
|
||||
- 2
|
||||
x-objectExtension:
|
||||
prop: 3
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: OAS31 Example
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/objectTypeUnion:
|
||||
post:
|
||||
parameters:
|
||||
- name: typeUnion
|
||||
in: query
|
||||
schema:
|
||||
type: [object, integer]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayTypeUnion:
|
||||
post:
|
||||
parameters:
|
||||
- name: typeUnion
|
||||
in: query
|
||||
schema:
|
||||
type: [array, integer]
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayItemTypeUnion:
|
||||
post:
|
||||
parameters:
|
||||
- name: itemTypeUnion
|
||||
in: query
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: [object, integer]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayTypeAndItemTypeUnion:
|
||||
post:
|
||||
parameters:
|
||||
- name: typeAndItemTypeUnion
|
||||
in: query
|
||||
schema:
|
||||
type: [array, integer]
|
||||
items:
|
||||
type: [object, string]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
@@ -0,0 +1,84 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Request Body Example
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/objectTypeUnion:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
objectTypeUnion:
|
||||
type: [object, integer]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayTypeUnion:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
arrayTypeUnion:
|
||||
type: [array, integer]
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayItemTypeUnion:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
arrayItemTypeUnion:
|
||||
type: array
|
||||
items:
|
||||
type: [object, integer]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayTypeAndItemTypeUnion:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
arrayTypeAndItemTypeUnion:
|
||||
type: [array, integer]
|
||||
items:
|
||||
type: [object, string]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
openapi: 3.1.0
|
||||
components:
|
||||
schemas:
|
||||
Expansion:
|
||||
properties:
|
||||
prop1:
|
||||
properties:
|
||||
prop2:
|
||||
properties:
|
||||
prop3:
|
||||
properties:
|
||||
prop4:
|
||||
type: string
|
||||
xml:
|
||||
x-extension:
|
||||
prop1:
|
||||
prop2:
|
||||
prop3:
|
||||
prop4: test
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: test
|
||||
version: "1.0.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Example Swagger
|
||||
version: '1.0'
|
||||
@@ -27,7 +27,7 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
type: number
|
||||
enum:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
description: debug flag
|
||||
@@ -60,4 +60,4 @@ paths:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: Some
|
||||
description: Some
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Parameter Schema Example
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/object:
|
||||
post:
|
||||
parameters:
|
||||
- in: query
|
||||
name: objectParam
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
/arrayOfObjects:
|
||||
post:
|
||||
parameters:
|
||||
- in: query
|
||||
name: arrayOfObjectsParam
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
servers:
|
||||
- url: /v3
|
||||
info:
|
||||
@@ -7,10 +7,10 @@ info:
|
||||
Swagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!
|
||||
You can now help us improve the API whether it's by making changes to the definition itself or to the code.
|
||||
That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
|
||||
|
||||
|
||||
Some useful links:
|
||||
- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
|
||||
- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
||||
- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
||||
version: 1.0.5-SNAPSHOT
|
||||
title: Swagger Petstore - OpenAPI 3.0
|
||||
termsOfService: 'http://swagger.io/terms/'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "Request body file upload"
|
||||
description: |-
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.3
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: multipart/form-data schema object
|
||||
version: 0.0.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.3
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: asd
|
||||
version: 0.0.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
paths:
|
||||
/:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: "Schema in Parameters"
|
||||
description: |-
|
||||
@@ -205,7 +205,7 @@ paths:
|
||||
components:
|
||||
/petOwner/createWithList:
|
||||
post:
|
||||
tags:
|
||||
tags:
|
||||
- petOwner
|
||||
summary: Creates list of pet owners with given input array
|
||||
operationId: petOwnerCreateWithList
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
description: No type for schema
|
||||
version: "1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
|
||||
info:
|
||||
version: 1.0.0
|
||||
@@ -6,7 +6,7 @@ info:
|
||||
|
||||
paths:
|
||||
/foo:
|
||||
get:
|
||||
get:
|
||||
description: Has date without quotes
|
||||
responses:
|
||||
'200':
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: json syntax highlighting
|
||||
description: sample OAS 3 definition to test syntax highlighting
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.2
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: try it out enabled test
|
||||
version: 0.0.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test API
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
info:
|
||||
title: Two
|
||||
@@ -9,4 +9,4 @@ paths:
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
description: OK
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Server Variables - One
|
||||
description: sample OAS 3 definition to test server variables with urls
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Server Variables - Two
|
||||
description: sample OAS 3 definition to test server variables with urls
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Webhooks does not exist in OpenAPI 3.0 and should not render
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Swagger Petstore
|
||||
@@ -138,12 +138,12 @@ components:
|
||||
|
||||
NewPet:
|
||||
required:
|
||||
- name
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
type: string
|
||||
|
||||
Error:
|
||||
required:
|
||||
@@ -158,7 +158,7 @@ components:
|
||||
securitySchemes:
|
||||
Petstore:
|
||||
type: oauth2
|
||||
flows:
|
||||
flows:
|
||||
implicit:
|
||||
authorizationUrl: https://example.com/api/oauth/dialog
|
||||
scopes:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.0
|
||||
openapi: 3.0.4
|
||||
info:
|
||||
title: Test anonymous operations
|
||||
version: 1.0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: "3.0.0"
|
||||
openapi: "3.0.4"
|
||||
|
||||
info:
|
||||
title: Sequential Import Chaining
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user