1.1.3 • Published 4 years ago

fastify-transform-body-plugin v1.1.3

Weekly downloads
40
License
-
Repository
-
Last release
4 years ago

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;
  },
};

Request body

Response body

1.1.1

4 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago