Operations
toOasOperationEntry
Creates a configured operation generator entry.
Transforms operation configuration arguments into a standardized operation generator entry that can be used within the SKMTC generation pipeline. Provides type-safe operation processing with optional enrichment support and preview capabilities.
Signature
import { toOasOperationEntry } from '@skmtc/core'
toOasOperationEntry<EnrichmentType = undefined>(
config: ToOasOperationConfigArgs<EnrichmentType>
): OasOperationEntry<EnrichmentType>Type of enrichment data this operation provides
Parameters
Configuration object defining operation behavior
Every projection class this generator can insert: its own, and each one of another generator that it inserts. Core reads only their statics. See DeclaredProjection. Optional.
Optional: whether this generator entry supports variants. Defaults to a function returning false when omitted.
Optional: compute the DEFAULT enrichment values for an operation from its schema - the seed the CMS persists and the user then edits. Typically a thin forward to the projection base's static of the same name (toEnrichmentDefaults: MyProjection.toEnrichmentDefaults) so the logic has a single home in base.ts while the entry exposes it to the seeding pass (which walks the generator-config map, not projection classes).
import { toOperationEntry } from '@skmtc/core';
const operationEntry = toOperationEntry({
id: 'my-operation-generator',
transform: ({ context, operation }) => {
context.insertOperation({ projection: MyOperation, operation });
},
isSupported: ({ operation }) => {
return operation.method === 'POST';
}
});Returns
Configured operation generator entry ready for pipeline integration