swagger-camelcase-properties-to-snakecase
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

swagger-camelcase-properties-to-snakecase

swagger camelcase properties to snakecase

Install

$ npm install -g swagger-camelcase-properties-to-snakecase

Usage

stdio

cat __tests__/nestedSwagger.yaml | npx swagger-camelcase-properties-to-snakecase

fix file

npx swagger-camelcase-properties-to-snakecase __tests__/nestedSwagger.yaml

Spec

import * as fs from 'fs'
import * as path from 'path'
import { swaggerCamelCasePropertiesToSnakeCase } from 'swagger-camelcase-properties-to-snakecase';

const nestedSwaggerYaml = fs.readFileSync(path.resolve(__dirname, './nestedSwagger.yaml')).toString().trim()
const snakeCaseNestedSwagger = fs.readFileSync(path.resolve(__dirname, './snakeCaseNestedSwagger.yaml')).toString().trim()

test('nested properties', () => {
  const result = swaggerCamelCasePropertiesToSnakeCase(nestedSwaggerYaml).trim()

  expect(result).toBe(snakeCaseNestedSwagger);
});

Dependents (0)

Package Sidebar

Install

npm i swagger-camelcase-properties-to-snakecase

Weekly Downloads

132

Version

1.0.6

License

MIT

Unpacked Size

15.4 kB

Total Files

15

Last publish

Collaborators

  • k-okina