Skip to content

Commit

Permalink
fix(core): fixes service schemas getter
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Nov 27, 2019
1 parent aeb651d commit 4c5ce88
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions 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(
Expand All @@ -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 };
}

0 comments on commit 4c5ce88

Please sign in to comment.