@apicurio/artifact-type-builtins
v3.2.3
Published
Built-in functions and TypeScript type definitions for creating custom artifact types in Apicurio Registry
Readme
@apicurio/artifact-type-builtins
Built-in functions and TypeScript type definitions for creating custom artifact types in Apicurio Registry.
Overview
This package provides the TypeScript type definitions and built-in utility functions needed to develop custom artifact types for Apicurio Registry. It enables type safety and IDE autocomplete support when implementing custom artifact type handlers in JavaScript/TypeScript.
Installation
npm install @apicurio/artifact-type-builtinsUsage
Import the types and built-in functions in your custom artifact type implementation:
import {
ArtifactTypeScriptProvider,
info,
debug
} from '@apicurio/artifact-type-builtins';
export function acceptsContent(request: any): boolean {
info('Checking if content is accepted');
// Your implementation here
return true;
}
export function validate(request: any): any {
debug('Validating artifact content');
// Your implementation here
return {
ruleViolations: []
};
}
// Implement other required functions...Example
For a complete example of creating a custom artifact type, see the TOML Artifact Type Example in the Apicurio Registry repository.
License
Apache License 2.0
