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

apidoc-light

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apidoc-light - npm Package Compare versions

Comparing version 0.51.0 to 0.51.1

24

lib/core/parser.js

@@ -512,11 +512,20 @@ /*

for (const block of parsedBlocks) {
let paramFields = block.local.parameter && block.local.parameter.fields && block.local.parameter.fields.Parameter;
if (!paramFields) {
paramFields = [];
let paramFields = [];
if (block.local.parameter && block.local.parameter.fields) {
// Loop all fields regardless of the field group. The default field group is `Parameter` but it could be provided by the developer.
for (const key in block.local.parameter.fields) {
paramFields = paramFields.concat(block.local.parameter.fields[key]);
}
}
const urlParams = [];
if (block.local.url) {
for (const urlFrag of block.local.url.split('/')) {
if (urlFrag[0] === ':') {
urlParams.push(urlFrag.slice(1));
// The dummy URL base is only used for parses of relative URLs.
const url = new URL(block.local.url, 'https://dummy.base');
// For API parameters in the URL parts delimited by `/` (e.g. `/:foo/:bar`).
for (const pathnamePart of url.pathname.split('/')) {
if (pathnamePart.charAt(0) === ':') {
urlParams.push(pathnamePart.slice(1));
}

@@ -531,3 +540,4 @@ }

for (const paramField of paramFields) {
if (!urlParams.some(up => up === paramField.field)) {
// Emit the warning only if the field is mandatory.
if (!paramField.optional && !urlParams.some(up => up === paramField.field)) {
log.warn(`@apiParam '${paramField.field}' was defined but does not appear in URL of @api '${block.local.title}' in file: '${filename}'`);

@@ -534,0 +544,0 @@ }

{
"name": "apidoc-light",
"version": "0.51.0",
"version": "0.51.1",
"description": "RESTful web API Documentation Generator",

@@ -5,0 +5,0 @@ "author": {

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