-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
167 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/fastify-capture", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/json-pointer-helpers", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/openapi-io", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/openapi-utilities", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/optic", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/rulesets-base", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@useoptic/standard-rulesets", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"version": "0.53.10-1", | ||
"version": "0.53.10-2", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"files": [ | ||
|
24 changes: 24 additions & 0 deletions
24
projects/standard-rulesets/src/lintgpt/__tests__/__snapshots__/prepare-openapi.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`can reduce size of operations by removing nested schemas 1`] = `undefined`; | ||
|
||
exports[`can reduce size of responses by deleting descriptions + examples 1`] = ` | ||
{ | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"properties": { | ||
"description": { | ||
"type": "string", | ||
}, | ||
"example": { | ||
"type": "string", | ||
}, | ||
}, | ||
"type": "object", | ||
}, | ||
}, | ||
}, | ||
"description": "The response", | ||
} | ||
`; |
84 changes: 84 additions & 0 deletions
84
projects/standard-rulesets/src/lintgpt/__tests__/prepare-openapi.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { test, expect } from '@jest/globals'; | ||
import { prepareOperation, prepareResponse } from '../prepare-openapi'; | ||
|
||
test('can reduce size of operations by removing nested schemas ', () => { | ||
const output = prepareOperation({ | ||
description: 'delete all the orders for this user', | ||
parameters: [ | ||
{ | ||
name: 'a', | ||
in: 'query', | ||
description: '123', | ||
example: '123', | ||
}, | ||
], | ||
requestBody: { | ||
description: 'what to send', | ||
required: true, | ||
content: { | ||
'application/json': { | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
description: { | ||
type: 'string', | ||
}, | ||
orders: { | ||
type: 'array', | ||
description: 'item-ids', | ||
example: ['1', '2', '3'], | ||
items: { | ||
type: 'string', | ||
description: 'itemIds', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
responses: { | ||
'200': { | ||
description: 'The response', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
description: { | ||
type: 'string', | ||
description: 'Delete me', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
expect(output).toMatchSnapshot(); | ||
}); | ||
|
||
test('can reduce size of responses by deleting descriptions + examples ', () => { | ||
const output = prepareResponse({ | ||
description: 'The response', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
description: { | ||
type: 'string', | ||
description: 'Delete me', | ||
}, | ||
example: { | ||
type: 'string', | ||
example: '123', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
expect(output).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters