Something went wrong. Try again.
fork of hey-api/openapi-ts because I need some additional things
Something went wrong. Try again.
524 B · 19 lines
TypeScript
1234567891011121314151617181920import type { PluginContext } from '@hey-api/shared';
import type { UserConfig } from '../types';import type { ExamplesConfig } from './types';
type Config = Omit<UserConfig, 'name'>;
export function resolveExamples(config: Config, context: PluginContext): ExamplesConfig { return context.valueToObject({ defaultValue: { enabled: Boolean(config.examples), language: 'Python', }, mappers: { boolean: (enabled) => ({ enabled }), }, value: config.examples, }) as ExamplesConfig;}