1.1.3 • Published 4 years ago
fastify-transform-body-plugin v1.1.3
Fastify Transform Body Plugin
https://crypt.codemancers.com/posts/2016-03-25-api-transformations-in-rails/
"test": "npm run build && node dist/test.js"
Options
enum CaseFormat {
CamelCase = 'CAMEL_CASE',
SnakeCase = 'SNAKE_CASE',
}
interface Options {
internalCaseFormat: CaseFormat;
caseFormatResolver: any;
}
const options: Options = {
// What naming convention your API uses internally
internalFormat: CaseFormat.CamelCase,
// What naming convention uses client that calls API
caseFormatResolver: async (request, reply) => {
// e.g. resolve based on User-Agent header
return CaseFormat.SnakeCase;
},
};