Skip to content

Instantly share code, notes, and snippets.

@israeleriston
Created May 17, 2018 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save israeleriston/b54eb7aebbfbbf596a9a16a0a42eb533 to your computer and use it in GitHub Desktop.
Save israeleriston/b54eb7aebbfbbf596a9a16a0a42eb533 to your computer and use it in GitHub Desktop.
Simple scheme using fastify
const schema = {
response: {
'2xx': {
type: 'object',
properties: {
value: { type: 'string' },
otherValue: { type: 'boolean' }
}
},
201: {
type: 'object',
properties: {
value: { type: 'string' }
}
}
}
}
fastify.post('/the/url', { schema }, handler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment