diff --git a/types/index.d.ts b/types/index.d.ts index 9f4645f..0546135 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -8,11 +8,7 @@ declare namespace SerializerSelector { options?: Options ) => SerializerCompiler - export type SerializerCompiler = ( - externalSchemas?: unknown, - options?: Options - ) => Serializer - + export type SerializerCompiler = (routeDef: RouteDefinition) => Serializer export type Serializer = (doc: any) => string export type RouteDefinition = { diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 641c476..018759a 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -37,7 +37,7 @@ import SerializerSelector, { expectType(factory) const compiler = factory(externalSchemas1, {}) expectType(compiler) - const serializeFunc = compiler({ schema: sampleSchema }) + const serializeFunc = compiler({ schema: sampleSchema, method: '', url: '', httpStatus: '' }) expectType(serializeFunc) expectType(serializeFunc({ name: 'hello' })) @@ -86,6 +86,9 @@ expectType(writer) } const endpointSchema = { + method: '', + url: '', + httpStatus: '', schema: { $id: 'urn:schema:endpoint', $ref: 'urn:schema:ref'