├── .github └── fabricbot.json ├── .gitignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── .vscode └── settings.json ├── Gruntfile.js ├── LICENSE ├── README.md ├── __tests__ ├── __snapshots__ │ └── runner.js.snap ├── fixtures │ ├── addProps │ │ └── swagger.json │ ├── collectionFormat │ │ └── swagger.json │ ├── petshop │ │ └── swagger.json │ ├── protected │ │ └── swagger.json │ ├── ref │ │ └── swagger.json │ ├── responses │ │ └── swagger.json │ ├── rootPath │ │ └── swagger.json │ ├── uber │ │ └── swagger.json │ └── users │ │ └── swagger.json └── runner.js ├── bin └── swagger2ts.js ├── package.json ├── src ├── cli.ts ├── codegen.test.ts ├── codegen.ts ├── enhance │ ├── beautify.test.ts │ ├── beautify.ts │ ├── index.test.ts │ └── index.ts ├── generators │ ├── codeGenerator.ts │ └── swagger2.ts ├── getViewForSwagger2.test.ts ├── getViewForSwagger2.ts ├── options │ ├── options.test.ts │ └── options.ts ├── swagger │ └── Swagger.ts ├── test-helpers │ └── testHelpers.ts ├── transform │ ├── transformToCodeWithMustache.test.ts │ └── transformToCodeWithMustache.ts ├── type-mappers │ ├── any.ts │ ├── array.ts │ ├── boolean.ts │ ├── enum.ts │ ├── number.ts │ ├── object.ts │ ├── reference.ts │ ├── schema.ts │ ├── string.ts │ └── void.ts ├── typescript.test.ts ├── typescript.ts ├── typespec.ts └── view-data │ ├── definition.ts │ ├── headers.ts │ ├── method.ts │ ├── operation.ts │ ├── parameter.ts │ ├── responseType.ts │ └── version.ts ├── templates ├── class.mustache ├── method.mustache └── type.mustache ├── tests ├── apis │ ├── allOf.json │ ├── protected.json │ ├── ref.json │ ├── rootPath.json │ ├── test.json │ ├── uber.json │ └── users.json └── generation.js └── tsconfig.json /.github/fabricbot.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/.github/fabricbot.json -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/.gitignore -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/.jshintrc -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | test/ 3 | .DS_Store 4 | *.swp 5 | src/ 6 | coverage/ 7 | yarn-error.log -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/.travis.yml -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true 3 | } -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/Gruntfile.js -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/README.md -------------------------------------------------------------------------------- /__tests__/__snapshots__/runner.js.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/__snapshots__/runner.js.snap -------------------------------------------------------------------------------- /__tests__/fixtures/addProps/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/addProps/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/collectionFormat/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/collectionFormat/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/petshop/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/petshop/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/protected/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/protected/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/ref/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/ref/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/responses/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/responses/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/rootPath/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/rootPath/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/uber/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/uber/swagger.json -------------------------------------------------------------------------------- /__tests__/fixtures/users/swagger.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/fixtures/users/swagger.json -------------------------------------------------------------------------------- /__tests__/runner.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/__tests__/runner.js -------------------------------------------------------------------------------- /bin/swagger2ts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/bin/swagger2ts.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/package.json -------------------------------------------------------------------------------- /src/cli.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/cli.ts -------------------------------------------------------------------------------- /src/codegen.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/codegen.test.ts -------------------------------------------------------------------------------- /src/codegen.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/codegen.ts -------------------------------------------------------------------------------- /src/enhance/beautify.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/enhance/beautify.test.ts -------------------------------------------------------------------------------- /src/enhance/beautify.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/enhance/beautify.ts -------------------------------------------------------------------------------- /src/enhance/index.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/enhance/index.test.ts -------------------------------------------------------------------------------- /src/enhance/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/enhance/index.ts -------------------------------------------------------------------------------- /src/generators/codeGenerator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/generators/codeGenerator.ts -------------------------------------------------------------------------------- /src/generators/swagger2.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/generators/swagger2.ts -------------------------------------------------------------------------------- /src/getViewForSwagger2.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/getViewForSwagger2.test.ts -------------------------------------------------------------------------------- /src/getViewForSwagger2.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/getViewForSwagger2.ts -------------------------------------------------------------------------------- /src/options/options.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/options/options.test.ts -------------------------------------------------------------------------------- /src/options/options.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/options/options.ts -------------------------------------------------------------------------------- /src/swagger/Swagger.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/swagger/Swagger.ts -------------------------------------------------------------------------------- /src/test-helpers/testHelpers.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/test-helpers/testHelpers.ts -------------------------------------------------------------------------------- /src/transform/transformToCodeWithMustache.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/transform/transformToCodeWithMustache.test.ts -------------------------------------------------------------------------------- /src/transform/transformToCodeWithMustache.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/transform/transformToCodeWithMustache.ts -------------------------------------------------------------------------------- /src/type-mappers/any.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/any.ts -------------------------------------------------------------------------------- /src/type-mappers/array.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/array.ts -------------------------------------------------------------------------------- /src/type-mappers/boolean.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/boolean.ts -------------------------------------------------------------------------------- /src/type-mappers/enum.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/enum.ts -------------------------------------------------------------------------------- /src/type-mappers/number.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/number.ts -------------------------------------------------------------------------------- /src/type-mappers/object.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/object.ts -------------------------------------------------------------------------------- /src/type-mappers/reference.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/reference.ts -------------------------------------------------------------------------------- /src/type-mappers/schema.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/schema.ts -------------------------------------------------------------------------------- /src/type-mappers/string.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/string.ts -------------------------------------------------------------------------------- /src/type-mappers/void.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/type-mappers/void.ts -------------------------------------------------------------------------------- /src/typescript.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/typescript.test.ts -------------------------------------------------------------------------------- /src/typescript.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/typescript.ts -------------------------------------------------------------------------------- /src/typespec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/typespec.ts -------------------------------------------------------------------------------- /src/view-data/definition.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/definition.ts -------------------------------------------------------------------------------- /src/view-data/headers.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/headers.ts -------------------------------------------------------------------------------- /src/view-data/method.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/method.ts -------------------------------------------------------------------------------- /src/view-data/operation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/operation.ts -------------------------------------------------------------------------------- /src/view-data/parameter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/parameter.ts -------------------------------------------------------------------------------- /src/view-data/responseType.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/responseType.ts -------------------------------------------------------------------------------- /src/view-data/version.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/src/view-data/version.ts -------------------------------------------------------------------------------- /templates/class.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/templates/class.mustache -------------------------------------------------------------------------------- /templates/method.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/templates/method.mustache -------------------------------------------------------------------------------- /templates/type.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/templates/type.mustache -------------------------------------------------------------------------------- /tests/apis/allOf.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/allOf.json -------------------------------------------------------------------------------- /tests/apis/protected.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/protected.json -------------------------------------------------------------------------------- /tests/apis/ref.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/ref.json -------------------------------------------------------------------------------- /tests/apis/rootPath.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/rootPath.json -------------------------------------------------------------------------------- /tests/apis/test.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/test.json -------------------------------------------------------------------------------- /tests/apis/uber.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/uber.json -------------------------------------------------------------------------------- /tests/apis/users.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/apis/users.json -------------------------------------------------------------------------------- /tests/generation.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tests/generation.js -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtennoe/swagger-typescript-codegen/HEAD/tsconfig.json --------------------------------------------------------------------------------