New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@openapi-contrib/json-schema-to-openapi-schema

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openapi-contrib/json-schema-to-openapi-schema - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

CHANGELOG.md

@@ -7,3 +7,3 @@ # Changelog

## [1.0.0] - 2019-01-20
## [1.0.0] - 2020-01-20

@@ -10,0 +10,0 @@ ### Changed

@@ -173,3 +173,3 @@ 'use strict';

function rewriteConst(schema) {
if (schema.const) {
if (Object.hasOwnProperty.call(schema, 'const')) {
schema.enum = [ schema.const ];

@@ -176,0 +176,0 @@ delete schema.const;

{
"name": "@openapi-contrib/json-schema-to-openapi-schema",
"version": "1.0.0",
"version": "1.0.1",
"description": "Converts a JSON Schema to OpenAPI Schema Object",

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

@@ -96,2 +96,3 @@ # JSON Schema to OpenAPI Schema

- [Stoplight][] for donating time and effort to this project, and many more.
- [mikunn][] for creating [openapi-schema-to-json-schema] which this is based on.

@@ -104,2 +105,3 @@ - [Phil Sturgeon][] for flipping that conversion script about face.

[WeWork]: https://github.com/wework
[Stoplight]: https://stoplight.io/
[Phil Sturgeon]: https://github.com/philsturgeon

@@ -106,0 +108,0 @@ [openapi-schema-to-json-schema]: https://github.com/mikunn/openapi-schema-to-json-schema

@@ -22,1 +22,18 @@ 'use strict';

});
it('falsy const', async () => {
const schema = {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'boolean',
const: false
};
const result = await convert(schema);
const expected = {
type: 'boolean',
enum: [ false ]
};
should(result).deepEqual(expected, 'converted');
});
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