From 4c5ce88a91d7bbe8494193c60daeb3248fc47b70 Mon Sep 17 00:00:00 2001 From: Rafa Mel Date: Wed, 27 Nov 2019 18:59:33 +0100 Subject: [PATCH] fix(core): fixes service schemas getter --- packages/core/src/inspect/schemas.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/core/src/inspect/schemas.ts b/packages/core/src/inspect/schemas.ts index 007d264..d184791 100644 --- a/packages/core/src/inspect/schemas.ts +++ b/packages/core/src/inspect/schemas.ts @@ -1,8 +1,8 @@ -import { ServiceUnion, CollectionTreeUnion, SchemaUnion } from '~/types'; +import { ServiceUnion, CollectionTreeUnion, JSONSchema } from '~/types'; export interface ServiceSchemas { - request: SchemaUnion; - response: SchemaUnion; + request: JSONSchema; + response: JSONSchema; } export function schemas( @@ -20,13 +20,5 @@ export function schemas( response = schema; } - // TODO - // if (service.nullable) { - // const validate = validator.compile(response); - // if (!validate(null)) { - // response = { anyOf: [{ type: 'null' }, response] }; - // } - // } - - return { request, response }; + return { request: request.schema, response: response.schema }; }