Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix: updating the oas package to pull in some fixes for handling resp…
Browse files Browse the repository at this point in the history
…onse schemas (#461)
  • Loading branch information
erunion committed Jan 28, 2020
1 parent d65dc97 commit 63539b9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 708 deletions.
28 changes: 0 additions & 28 deletions packages/api-explorer/__tests__/ResponseSchemaBody.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const { shallow, mount } = require('enzyme');
const Oas = require('oas');

const ResponseSchemaBody = require('../src/ResponseSchemaBody');
const { flattenResponseSchema } = require('../src/ResponseSchemaBody');
const { flatten } = require('../src/ResponseSchemaBody');
const petstore = require('./fixtures/petstore/oas.json');

const oas = new Oas(petstore);
Expand Down Expand Up @@ -42,27 +40,6 @@ test('display properties if object contains $ref type', () => {
).toHaveLength(1);
});

test('should flatten schema to an array', () => {
const responseSchema = {
type: 'object',
properties: {
category: {
type: 'array',
items: {
type: 'string',
},
},
},
};
expect(flattenResponseSchema(responseSchema)).toStrictEqual([
{
name: 'category',
type: '[String]',
description: undefined,
},
]);
});

test('display object properties inside another object in the table', () => {
const schema = {
type: 'object',
Expand Down Expand Up @@ -308,8 +285,3 @@ test('should show "array" response schema type', () => {
.text(),
).toBe('Response schema type: array of objects');
});

test('should flatten array', () => {
const array = [[1], [2, 3], [[4, 5]]];
expect(flatten(array)).toStrictEqual([1, 2, 3, 4, 5]);
});
Loading

0 comments on commit 63539b9

Please sign in to comment.