MCPcopy
hub / github.com/fastify/fastify / getResponseSchema

Function getResponseSchema

test/internals/reply-serialize.test.js:18–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18function getResponseSchema () {
19 return {
20 201: {
21 type: 'object',
22 required: ['status'],
23 properties: {
24 status: {
25 type: 'string',
26 enum: ['ok']
27 },
28 message: {
29 type: 'string'
30 }
31 }
32 },
33 '4xx': {
34 type: 'object',
35 properties: {
36 status: {
37 type: 'string',
38 enum: ['error']
39 },
40 code: {
41 type: 'integer',
42 minimum: 1
43 },
44 message: {
45 type: 'string'
46 }
47 }
48 },
49 '3xx': {
50 content: {
51 'application/json': {
52 schema: {
53 type: 'object',
54 properties: {
55 fullName: { type: 'string' },
56 phone: { type: 'number' }
57 }
58 }
59 }
60 }
61 }
62 }
63}
64
65test('Reply#compileSerializationSchema', async t => {
66 t.plan(4)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected