Registry / devops / apidoc-plugin-schema

apidoc-plugin-schema

JSON →
library0.1.8jsnpmunverified

An apidoc plugin that automatically generates documentation elements from JSON Schema definitions. Version 0.1.8, last updated in 2016. It allows injecting schema-defined parameters and success responses into apidoc comments via @apiSchema tags. Supports JSON Schema features like types, enums, nesting (objects/arrays), and required fields. Compared to manual apidoc annotations, this plugin reduces duplication by reusing existing schemas. The project is in early stage with limited maintenance.

npm install apidoc-plugin-schema
INSTALL
IMPORT
SIG · APIDOC-PLUGIN-SCHE
A
apidoc-plugin-schema
devopsjavascriptv0.1.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

apidoc-plugin-schema
import 'apidoc-plugin-schema'; // or require('apidoc-plugin-schema')
const schemaPlugin = require('apidoc-plugin-schema'); // No default export, side-effect only
Plugin registers itself with apidoc; no explicit import needed beyond installation.

Demonstrates installation, schema file example, and @apiSchema usage to inject parameters from a JSON Schema file into apidoc output.

// Install via npm npm install apidoc-plugin-schema --save-dev // Create a JSON Schema file (./schema/user.req.json) { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer", "minimum": 0 } }, "required": ["name"] } // In an API source file, use @apiSchema tag /** * @api {post} /user Create User * @apiSchema (Body) {jsonschema=./schema/user.req.json} apiParam */ // Run apidoc (requires apidoc globally or via npx) // apidoc -i src/ -o doc/
Debug
Known issues
breakingPlugin does not support apidoc >= 1.0 due to API changes.
fix
Pin apidoc to version 0.x or find an alternative plugin.
affects: >=1.0
deprecatedThe plugin has not been updated since 2016 and is effectively unmaintained.
fix
Consider using newer tools like @apidoc/plugin or manual schema generation.
affects: >=0.1.0
gotchaSchema paths are relative to the apidoc working directory, not the source file.
fix
Use absolute paths or adjust relative paths from your project root.
affects: >=0.1.0
gotchaDuplicated @apiSchema tags may cause unexpected merging behavior.
fix
Ensure each endpoint has unique schema references to avoid collisions.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'apidoc-plugin-schema'
Plugin not installed or not listed in devDependencies.
fix
Run 'npm install apidoc-plugin-schema --save-dev' and ensure it's in node_modules.
apidoc: plugin 'apidoc-plugin-schema' not found or inactive
apidoc version mismatch (plugin only works with apidoc < 1.0).
fix
Use apidoc@0.x or check plugin compatibility.
Error: Schema file not found: ./schema/user.req.json
Schema file path is incorrect or relative path is not from the root of the project.
fix
Ensure the schema file exists at the specified path relative to where you run apidoc.
Upgrade
Version history
0.1.8latest on npm
Audit
Dependencies
apidocrequiredRequires apidoc as the host tool that runs plugins and parses comments.
Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources
apidoc-plugin-schema — npm install apidoc-plugin-schema · libregistry