Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@redocly/openapi-core

Package Overview
Dependencies
Maintainers
4
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redocly/openapi-core - npm Package Compare versions

Comparing version 1.0.0-beta.40 to 1.0.0-beta.41

63

__tests__/bundle.test.ts

@@ -13,30 +13,27 @@ import outdent from 'outdent';

const testDocument = parseYamlToDocument(
outdent`
openapi: 3.0.0
paths:
/pet:
get:
operationId: get
parameters:
- $ref: '#/components/parameters/shared_a'
- name: get_b
post:
operationId: post
parameters:
- $ref: '#/components/parameters/shared_a'
components:
parameters:
shared_a:
name: shared-a
`,
'',
);
it('change nothing with only internal refs', async () => {
const document = parseYamlToDocument(
outdent`
openapi: 3.0.0
info:
contact: {}
license: {}
paths:
/pet:
get:
operationId: get
parameters:
- $ref: '#/components/parameters/shared_a'
- name: get_b
post:
operationId: post
parameters:
- $ref: '#/components/parameters/shared_a'
components:
parameters:
shared_a:
name: shared-a
`,
'',
);
const { bundle, problems } = await bundleDocument({
document,
document: testDocument,
externalRefResolver: new BaseResolver(),

@@ -46,3 +43,3 @@ config: new LintConfig({}),

const origCopy = JSON.parse(JSON.stringify(document.parsed));
const origCopy = JSON.parse(JSON.stringify(testDocument.parsed));

@@ -73,2 +70,14 @@ expect(problems).toHaveLength(0);

});
it('should dereferenced correctly when used with dereference', async () => {
const { bundle: res, problems } = await bundleDocument({
externalRefResolver: new BaseResolver(),
config: new LintConfig({}),
document: testDocument,
dereference: true,
});
expect(problems).toHaveLength(0);
expect(res.parsed).toMatchSnapshot();
});
});

@@ -131,3 +131,4 @@ "use strict";

resolved.location.source === ctx.location.source &&
ctx.type.name !== 'scalar') {
ctx.type.name !== 'scalar' &&
!dereference) {
return;

@@ -134,0 +135,0 @@ }

{
"name": "@redocly/openapi-core",
"version": "1.0.0-beta.40",
"version": "1.0.0-beta.41",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -166,3 +166,4 @@ import isEqual = require('lodash.isequal');

resolved.location.source === ctx.location.source &&
ctx.type.name !== 'scalar'
ctx.type.name !== 'scalar' &&
!dereference
) {

@@ -169,0 +170,0 @@ return;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc