Schemas
CustomValue
Represents a custom value in the SKMTC generation pipeline.
CustomValue allows generators to create arbitrary content that doesn't fit standard schema types. Used for injecting custom code, templates, or specialized content during the generation process.
Signature
import { CustomValue } from '@skmtc/core'
class CustomValue extends SnippetBaseExamples
const customValue = new CustomValue({
context: generateContext,
value: 'const customCode = "generated";',
generatorKey: 'my-generator'
});
console.log(customValue.toString()); // "const customCode = "generated";"Constructor
constructor
constructor(args: CreateArgs)Creates a new CustomValue instance.
Creation arguments including context, value, and optional generator key
Properties
Type identifier for this custom value
The underlying value content that can be converted to string
Methods
isRef
isRef(): this is OasRef<'schema'>Determines if this custom value is a reference.
Always false since custom values are concrete content, not references
isReadOnly
isReadOnly(): booleanAlways false: this value has no readOnly.
isWriteOnly
isWriteOnly(): booleanAlways false: this value has no writeOnly.
resolve
resolve(): CustomValueResolves this custom value.
The custom value itself since it's already resolved
resolveOnce
resolveOnce(): CustomValueResolves this custom value one level.
The custom value itself since it's already resolved
toString
toString(): stringConverts the custom value to its string representation.
String representation of the underlying value