mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
feat: add test and improve code
This commit is contained in:
parent
a3d00ea6a1
commit
95d6aa46df
|
@ -1,4 +1,4 @@
|
|||
openapi: 3.0.0
|
||||
openapi: 3.1.0
|
||||
servers:
|
||||
- url: //petstore.swagger.io/v2
|
||||
description: Default server
|
||||
|
@ -42,6 +42,7 @@ info:
|
|||
|
||||
version: 1.0.0
|
||||
title: Swagger Petstore
|
||||
summary: My lovely API
|
||||
termsOfService: 'http://swagger.io/terms/'
|
||||
contact:
|
||||
name: API Support
|
||||
|
@ -53,6 +54,7 @@ info:
|
|||
license:
|
||||
name: Apache 2.0
|
||||
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
||||
identifier: Apache 2.0
|
||||
externalDocs:
|
||||
description: Find out how to create Github repo for your OpenAPI spec.
|
||||
url: 'https://github.com/Rebilly/generator-openapi-repo'
|
||||
|
@ -893,6 +895,38 @@ paths:
|
|||
default:
|
||||
description: successful operation
|
||||
components:
|
||||
pathItems:
|
||||
catsWebhook:
|
||||
put:
|
||||
summary: Get a cat details after update
|
||||
description: Get a cat details after update
|
||||
operationId: updatedCat
|
||||
tags:
|
||||
- pet
|
||||
requestBody:
|
||||
description: Information about cat in the system
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Cat"
|
||||
responses:
|
||||
'200':
|
||||
description: update Cat details
|
||||
post:
|
||||
summary: Create new cat
|
||||
description: Info about new cat
|
||||
operationId: createdCat
|
||||
tags:
|
||||
- pet
|
||||
requestBody:
|
||||
description: Information about cat in the system
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Cat"
|
||||
responses:
|
||||
'200':
|
||||
description: create Cat details
|
||||
schemas:
|
||||
ApiResponse:
|
||||
type: object
|
||||
|
@ -1040,7 +1074,8 @@ components:
|
|||
example: Guru
|
||||
photoUrls:
|
||||
description: The list of URL to a cute photos featuring pet
|
||||
type: array
|
||||
type: [string, integer, 'null', array]
|
||||
minItems: 1
|
||||
maxItems: 20
|
||||
xml:
|
||||
name: photoUrl
|
||||
|
@ -1054,7 +1089,8 @@ components:
|
|||
tags:
|
||||
description: Tags attached to the pet
|
||||
type: array
|
||||
minItems: 1
|
||||
exclusiveMaximum: 100
|
||||
exclusiveMinimum: 0
|
||||
xml:
|
||||
name: tag
|
||||
wrapped: true
|
||||
|
@ -1067,6 +1103,7 @@ components:
|
|||
- available
|
||||
- pending
|
||||
- sold
|
||||
default: pending
|
||||
petType:
|
||||
description: Type of a pet
|
||||
type: string
|
||||
|
@ -1187,7 +1224,7 @@ components:
|
|||
shipDate: '2018-10-19T16:46:45Z'
|
||||
status: placed
|
||||
complete: false
|
||||
x-webhooks:
|
||||
webhooks:
|
||||
newPet:
|
||||
post:
|
||||
summary: New pet
|
||||
|
@ -1203,3 +1240,7 @@ x-webhooks:
|
|||
responses:
|
||||
"200":
|
||||
description: Return a 200 status to indicate that the data was received successfully
|
||||
myWebhook:
|
||||
$ref: '#/components/pathItems/catsWebhook'
|
||||
description: Overriding description
|
||||
summary: Overriding summary
|
|
@ -6,7 +6,7 @@ describe('Menu', () => {
|
|||
it('should have valid items count', () => {
|
||||
cy.get('.menu-content')
|
||||
.find('li')
|
||||
.should('have.length', 34);
|
||||
.should('have.length', 36);
|
||||
});
|
||||
|
||||
it('should sync active menu items while scroll', () => {
|
||||
|
|
|
@ -6,7 +6,6 @@ import {
|
|||
Referenced,
|
||||
OpenAPIServer,
|
||||
OpenAPIPaths,
|
||||
OpenAPIPath,
|
||||
} from '../types';
|
||||
import {
|
||||
isOperationName,
|
||||
|
|
|
@ -13,6 +13,56 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
"pathItems": Object {
|
||||
"catsWebhook": Object {
|
||||
"post": Object {
|
||||
"description": "Info about new cat",
|
||||
"operationId": "createdCat",
|
||||
"requestBody": Object {
|
||||
"content": Object {
|
||||
"multipart/form-data": Object {
|
||||
"schema": Object {
|
||||
"$ref": "#/components/schemas/Cat",
|
||||
},
|
||||
},
|
||||
},
|
||||
"description": "Information about cat in the system",
|
||||
},
|
||||
"responses": Object {
|
||||
"200": Object {
|
||||
"description": "create Cat details",
|
||||
},
|
||||
},
|
||||
"summary": "Create new cat",
|
||||
"tags": Array [
|
||||
"pet",
|
||||
],
|
||||
},
|
||||
"put": Object {
|
||||
"description": "Get a cat details after update",
|
||||
"operationId": "updatedCat",
|
||||
"requestBody": Object {
|
||||
"content": Object {
|
||||
"multipart/form-data": Object {
|
||||
"schema": Object {
|
||||
"$ref": "#/components/schemas/Cat",
|
||||
},
|
||||
},
|
||||
},
|
||||
"description": "Information about cat in the system",
|
||||
},
|
||||
"responses": Object {
|
||||
"200": Object {
|
||||
"description": "update Cat details",
|
||||
},
|
||||
},
|
||||
"summary": "Get a cat details after update",
|
||||
"tags": Array [
|
||||
"pet",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
"requestBodies": Object {
|
||||
"Pet": Object {
|
||||
"content": Object {
|
||||
|
@ -292,13 +342,20 @@ Object {
|
|||
"type": "string",
|
||||
},
|
||||
"maxItems": 20,
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
"array",
|
||||
],
|
||||
"xml": Object {
|
||||
"name": "photoUrl",
|
||||
"wrapped": true,
|
||||
},
|
||||
},
|
||||
"status": Object {
|
||||
"default": "pending",
|
||||
"description": "Pet status in the store",
|
||||
"enum": Array [
|
||||
"available",
|
||||
|
@ -309,10 +366,11 @@ Object {
|
|||
},
|
||||
"tags": Object {
|
||||
"description": "Tags attached to the pet",
|
||||
"exclusiveMaximum": 100,
|
||||
"exclusiveMinimum": 0,
|
||||
"items": Object {
|
||||
"$ref": "#/components/schemas/Tag",
|
||||
},
|
||||
"minItems": 1,
|
||||
"type": "array",
|
||||
"xml": Object {
|
||||
"name": "tag",
|
||||
|
@ -485,9 +543,11 @@ and standard method from web, mobile and desktop applications.
|
|||
<SecurityDefinitions />
|
||||
",
|
||||
"license": Object {
|
||||
"identifier": "Apache 2.0",
|
||||
"name": "Apache 2.0",
|
||||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html",
|
||||
},
|
||||
"summary": "My lovely API",
|
||||
"termsOfService": "http://swagger.io/terms/",
|
||||
"title": "Swagger Petstore",
|
||||
"version": "1.0.0",
|
||||
|
@ -496,7 +556,7 @@ and standard method from web, mobile and desktop applications.
|
|||
"url": "https://redocly.github.io/redoc/petstore-logo.png",
|
||||
},
|
||||
},
|
||||
"openapi": "3.0.0",
|
||||
"openapi": "3.1.0",
|
||||
"paths": Object {
|
||||
"/pet": Object {
|
||||
"parameters": Array [
|
||||
|
@ -1745,29 +1805,12 @@ culpa qui officia deserunt mollit anim id est laborum.
|
|||
"x-displayName": "The Order Model",
|
||||
},
|
||||
],
|
||||
"x-tagGroups": Array [
|
||||
Object {
|
||||
"name": "General",
|
||||
"tags": Array [
|
||||
"pet",
|
||||
"store",
|
||||
],
|
||||
"webhooks": Object {
|
||||
"myWebhook": Object {
|
||||
"$ref": "#/components/pathItems/catsWebhook",
|
||||
"description": "Overriding description",
|
||||
"summary": "Overriding summary",
|
||||
},
|
||||
Object {
|
||||
"name": "User Management",
|
||||
"tags": Array [
|
||||
"user",
|
||||
],
|
||||
},
|
||||
Object {
|
||||
"name": "Models",
|
||||
"tags": Array [
|
||||
"pet_model",
|
||||
"store_model",
|
||||
],
|
||||
},
|
||||
],
|
||||
"x-webhooks": Object {
|
||||
"newPet": Object {
|
||||
"post": Object {
|
||||
"description": "Information about a new pet in the systems",
|
||||
|
@ -1793,6 +1836,28 @@ culpa qui officia deserunt mollit anim id est laborum.
|
|||
},
|
||||
},
|
||||
},
|
||||
"x-tagGroups": Array [
|
||||
Object {
|
||||
"name": "General",
|
||||
"tags": Array [
|
||||
"pet",
|
||||
"store",
|
||||
],
|
||||
},
|
||||
Object {
|
||||
"name": "User Management",
|
||||
"tags": Array [
|
||||
"user",
|
||||
],
|
||||
},
|
||||
Object {
|
||||
"name": "Models",
|
||||
"tags": Array [
|
||||
"pet_model",
|
||||
"store_model",
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
`;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user