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

api-doc-validator

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-doc-validator - npm Package Compare versions

Comparing version 1.8.0 to 1.9.0

lib/schemas/null.js

9

cli.js

@@ -9,3 +9,3 @@ #!/usr/bin/env node

const filesToEndpoints = require('./lib/filesToEndpoints');
const {generateAjvSchema} = require('./lib/parseSchema');
const {generateAjvSchema, getProp} = require('./lib/parseSchema');
const generateApiClient = require('./lib/generate/apiClient');

@@ -24,2 +24,3 @@ const generateExpressMiddleware = require('./lib/generate/expressMiddleware');

.option('-R, --jsdoc-refs <boolean>', 'use references to jsdoc @typedef or replace them with reference body, default true')
.option('-P, --extra-props <boolean>', 'value for ajv "object" additionalProperties, default false')
;

@@ -54,2 +55,3 @@

'jsdocTypedefs',
'extraProps',
]);

@@ -72,2 +74,7 @@

var defaultSchemas = getDefaultSchemas();
if (typeof config.extraProps === 'boolean') {
getProp(defaultSchemas.object, 'additionalProperties').value.value = config.extraProps;
}
var cache = {...defaultSchemas};

@@ -74,0 +81,0 @@

@@ -6,2 +6,6 @@ const t = require('@babel/types');

function getObjectName(root) {
if (t.isNullLiteral(root)) {
return 'null';
}
if (t.isBinaryExpression(root)) {

@@ -8,0 +12,0 @@ return minusExpressionToObjectName(root);

3

lib/parseSchema.js

@@ -24,2 +24,3 @@ const t = require('@babel/types');

module.exports.resetCache = resetCache;
module.exports.getProp = getProp;

@@ -72,3 +73,3 @@ function parseSchema(code) {

}
else if (t.isIdentifier(root) || t.isMemberExpression(root) || t.isBinaryExpression(root)) {
else if (t.isIdentifier(root) || t.isMemberExpression(root) || t.isBinaryExpression(root) || t.isNullLiteral(root)) {
return astObjectNameToAjvSchema(root);

@@ -75,0 +76,0 @@ }

@@ -8,2 +8,3 @@ const toAst = require('../toAst');

return {
null: require('./null'),
object: require('./object'),

@@ -10,0 +11,0 @@ string: require('./string'),

{
"name": "api-doc-validator",
"version": "1.8.0",
"version": "1.9.0",
"description": "api doc and validator",

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

@@ -726,2 +726,3 @@ # api ➡️ doc ➡️ validator

-R, --jsdoc-refs <boolean> use references to jsdoc @typedef or replace them with reference body, default true
-P, --extra-props <boolean> value for ajv "object" additionalProperties, default false
```

@@ -900,3 +901,4 @@

* `express` same as `--express <path>`
* `namespace` same as `--namespace <path>`
* `namespace` same as `--namespace <namespace>`
* `extraProps` same as `--extra-props <boolean>`

@@ -903,0 +905,0 @@ All paths are relative to config file location.

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