A VS Code extension that provides schema-driven IntelliSense (hover, validation, completions) for OpenAPI JSON and YAML files with custom linting rules.
- Hover support with rich descriptions from OpenAPI schemas
- Auto-completion for OpenAPI properties and values
- Schema validation with precise error reporting
- Multi-version support (OpenAPI 3.2, 3.1, 3.0, Swagger 2.0)
- Root validation: Ensures required
infosection - Schema naming: Enforces PascalCase for schema names
- Operation ID validation: Prevents duplicate operation IDs
- Path parameter validation: Ensures path parameters are declared
- Precise diagnostics: Errors highlight exact offending nodes
- $ref resolution: Follows references across multiple files
- Cross-document validation: Validates entire reference graphs
- File watching: Re-validates when referenced files change
- Circular reference detection: Prevents infinite loops
- Debounced validation: Configurable delay (default 300ms)
- File size limits: Configurable maximum file size (default 5MB)
- Intelligent caching: Reduces redundant processing
- Memory management: Automatic cache cleanup
- Version preference: Auto-detect or force specific OpenAPI version
- Type profile checking: Optional TypeScript-based validation
- Custom rules: Enable/disable specific validation rules
- Performance tuning: Adjust debounce delay and file size limits
- Download the
.vsixfile from the releases - In VS Code, go to Extensions → Install from VSIX
- Select the
aperture-0.0.1.vsixfile - Reload VS Code
- Open any OpenAPI YAML or JSON file
- The extension automatically detects the OpenAPI version
- IntelliSense and validation work immediately
- Check the Problems panel for validation errors
Open VS Code settings and search for "Aperture":
{
"openapiLsp.versionPreference": "auto", // "auto" | "3.2" | "3.1" | "3.0" | "2.0"
"openapiLsp.enableTypeProfile": false, // Enable TypeScript type checking
"openapiLsp.enableCustomRules": true, // Enable custom validation rules
"openapiLsp.maxFileSize": 5, // Maximum file size in MB
"openapiLsp.debounceDelay": 300 // Validation delay in milliseconds
}.yaml/.ymlfiles.jsonfiles- OpenAPI 3.2, 3.1, 3.0 specifications
- Swagger 2.0 specifications
- Client: VS Code extension host using
vscode-languageclient - Server: LSP server with custom OpenAPI validation
- Communication: IPC-based language server protocol
- Schema Loader: Reads schemas from external types package
- Ref Graph Builder: Resolves
$refreferences across files - Custom Rule Engine: Implements OpenAPI-specific validation rules
- Range Mapper: Maps JSON pointers to precise document ranges
- Performance Manager: Handles caching and debouncing
- @your/openapi-types: External package providing schemas and types
- vscode-json-languageservice: JSON schema validation
- yaml-language-server: YAML parsing and validation
- jsonc-parser: JSON with comments support
npm install
npm run buildnpm run package- Open the project in VS Code
- Press F5 to launch Extension Development Host
- Test with the example files in
/examples
The extension includes comprehensive test scenarios:
examples/openapi-3.2.yaml- OpenAPI 3.2 specificationexamples/openapi-3.1.yaml- OpenAPI 3.1 specificationexamples/swagger-2.0.yaml- Swagger 2.0 specification
examples/invalid-missing-info.yaml- Missing info sectionexamples/invalid-schema-naming.yaml- Incorrect schema namingexamples/invalid-duplicate-operation-id.yaml- Duplicate operation IDsexamples/invalid-path-parameters.yaml- Undeclared path parameters
- Rule:
root-info - Description: Root object must contain info section
- Severity: Error
- Rule:
schema-naming - Description: Schema names should be PascalCase
- Severity: Warning
- Rule:
operation-id - Description: Operations should have unique operationId
- Severity: Warning
- Rule:
path-parameter - Description: Path parameters must be declared in the path
- Severity: Warning
- Document cache: Caches parsed documents with version tracking
- Schema cache: Caches loaded schemas for reuse
- Range cache: Caches pointer-to-range mappings
- Configurable delay: Default 300ms, adjustable via settings
- Per-document timeouts: Each document has its own debounce timer
- Automatic cleanup: Timeouts are cleared when documents close
- Size limits: Configurable maximum file size (default 5MB)
- Graceful degradation: Large files show warning instead of crashing
- Memory protection: Prevents excessive memory usage
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details
- Initial release
- Schema-driven IntelliSense for OpenAPI files
- Custom rule engine with 4 validation rules
- Multi-file $ref resolution
- Performance optimizations and caching
- Comprehensive settings configuration
- Test scenarios and examples