Fixes:
- ContentType.FormData no longer sets the correct boundary (issue #172, thanks @Styn)
Fixes:
- header overwrite in
defaultandmodularAPI templates (issue #171 by @Styn, thanks @emilecantin for PR with fix)
Fixes:
- Ignored
x-nullablefield - Schema type names which starts with number or special characters
Fixes:
- Linter disable rules is not working (issue #164, thanks @Haritaso)
Fixes:
- The HttpResponse type is no longer exported from http-client (issue #161, thanks @Styn)
Fixes:
- Bug with optional nested properties of object schema type (issue #156, thanks @Fabiencdp)
Features:
onCreateRouteName(routeNameInfo: RouteNameInfo, rawRouteInfo: RawRouteInfo): RouteNameInfo | voidhook
Which allows to customize route name without customizingroute-name.etatemplate- Improved content kinds for request infos
--single-http-clientoption which allows to send HttpClient instance to Api constructor and not to create many count of HttpClient instances with--modularapi (issue #155)
Minor:
- A bit improve type declaration file (index.d.ts) for this tool
- make exportable
ApiConfiginterface
Internal:
- clearing
routeNameDuplicatesMapbefore eachparseRoutes()function call - Changed templates:
http-client.etaprocedure-call.etaapi.eta
Fixes:
- Request content types auto substitution
i.e. if request body is form data, then request body content type will bemultipart/form-data - Strange method name (issue #152, thanks @RoXuS)
- Hardcoded Content-Type causes issues with some endpoints (issue #153, thanks @po5i)
- Critical bug with
:paramNamepath params (issue #154)
Features:
- Ability to provide custom formatting
fetchresponse "IMAGE"content kind for response\request data objectsRequestParamsRequestHeaderstypes for--route-types(routeTypes: true) option (issue #150, thanks @Fabiencdp )--default-responseoption. Allows to set default type for empty response schema (default:void) (based on issue #14)- Request cancellation support (issue #96, thanks @ApacheEx)
RequestParamstype now have thecancelTokenfield
HttpClientinstance now have theabortRequest(cancelToken)method
BREAKING_CHANGES:
- Fully refactored
http-client.etatemplate, make it more flexible and simpler.
HttpClient["request"]takes one argument with typeFullRequestParams
(previously it takes many count of arguments which was not flexible) - Changed the default response body type from
anytovoid(issue #14)
Internal:
- Changed templates:
http-client.etaprocedure-call.etaapi.eta
This version works with previous templates.
Fixes:
- Client generation for
Content-Type: application/x-www-form-urlencoded(issue #146, thanks @Larox)
Internal:
- Changed templates:
http-client.etaprocedure-call.eta
Fixes:
- enum + nullable: true doesn't compute the good type (issue #145, thanks @RoXuS)
- Underscores are omitted from enum keys (issue #108, thanks @eolant)
- CLI silently fails if the directory to put new files in doesn't exist yet (issue #141, thanks @Styn)
Features:
- Improved type description
Internal:
- dependencies update:
"js-yaml": "^4.0.0"("^3.14.1")"make-dir": "^3.1.0""swagger2openapi": "^7.0.5"("^7.0.4")
- Difference in templates:
Features:
- new hook
onCreateRequestParamswhich allows modify request params (--extract-request-paramsoption) before sending it to route info

How to use:generateApi({ // ... your config, hooks: { onCreateRequestParams: (rawType) => { if (Object.keys(rawType.properties).length > 1) return rawType; return rawType; } } })
- response content types (array of string like
application/json,image/png) which allows to customize declaration of request response
Exist inprocedure-call.etatemplateit.route.response.contentTypes
Internal:
Features:
- Improve
require()function used in ETA templates (using relative path imports) --clean-outputoption.
clean output folder before generate api
Fixes:
- Error:
Unexpected token =(Issue #136, Thanks @jlow-mudbath) - Output folder creation (Issue #137, Thanks @Rinta01)
Create output folder if it is not exist
BREAKING_CHANGE:
- remove
'prettier-plugin-organize-imports'dependency from package
Fixes:
- issue #134 (Thanks @mrfratello)
Features:
- add
require()to templateutilsobject
Docs:
- add information about contributors
Features:
--disableStrictSSLoption for disable strict SSL statement with fetching swagger schema. (Thanks @kel666 for PR with feature request)
This option fix problem #114
Fixes:
Unexpected token '.'on v4 (Thanks @savingprivatebryan for issue #111)
Replaced all new syntax sugar like?.or??to prev. alternatives for support nodejs 12
Fixes:
Cannot find module 'prettier-plugin-organize-imports'#109
BREAKING_CHANGES:
- Migrate from mustache template engine to ETA template engine. (Thanks @Fl0pZz)
- Critical change in
HttpResponsetype (RemoveD | null,E | nullunions)
interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D | null;
+ data: D;
- error: E | null;
+ error: E;
}Features:
-
--modularoption. Allows to generate api class per module name.
Example: here -
new templates on ETA (enhanced EJS) which can improve your templates! (Thanks @Fl0pZz)
ETA extension for Visual Studio Code (thanks @shadowtime2000)
Also moved out to templates:procedure-call.eta(request api method template)route-name.eta(api method name template)route-docs.eta(api method docs template)
No worry about strange syntax it is very simple in usage :)
-
Optional templates feature (Except templates using in
includeFileETAdirective)
Now you can store only theETAtemplates which you need to change for yourself. -
--extract-request-paramsoption. Generate path and query request params data contract and modify request payload args
Example:

-
Improve
data-contracts.etatemplate. Added more power :) -
Add
extraTemplatesproperty forgenerateApi(). Allows to generate extra files via this tool. -
Add
hooksproperty forgenerateApi()hooks?: Partial<{ onCreateComponent: (component: SchemaComponent) => SchemaComponent | void; onParseSchema: (originalSchema: any, parsedSchema: any) => any | void; onCreateRoute: (routeData: ParsedRoute) => ParsedRoute | void; /** Start point of work this tool (after fetching schema) */ onInit?: <C extends GenerateApiConfiguration["config"]>(configuration: C) => C | void; /** Allows to customize configuration object before sending it to templates. */ onPrepareConfig?: <C extends GenerateApiConfiguration>(currentConfiguration: C) => C | void; }>;
generateApi({ input: "./schema.json", output: "./__generated__", hooks: { onCreateComponent(component) { // do something return component; }, // ... } })
Internal:
- Update all dependencies to latest
Fixes:
x-enumNamessupport for enums- Problem of complex types (
oneOf,allOf) withpropertiesfield additionalProperties: trueshould make[key: string]: anyfor object types (Thanks @brookjordan for issue #103)
Common:
HttpClientis exportable by default- Improve typings when use
swagger-typescript-apiwith NodeJS (index.d.ts)
Fixes:
- axios vulnerability (#101 issue, thanks @Mvbraathen)
Fixes:
name.includes is not a function(issue #98)
Features:
--moduleNameIndexoption. determines which path index should be used for routes separation (Thanks @nikalun)
Examples:
GET:api/v1/fruites/getFruit -> index:2 -> moduleName -> fruites GET:api/v1/fruites/getFruit -> index:0 -> moduleName -> api
Fixes:
- invalid default templates path (#92, thanks @larrybotha for quick fix)
BREAKING_CHANGES:
- Renamed mustache templates:
api.mustache->data-contracts.mustacheclient.mustache->http.client.mustache+api.mustache
- Split the
client.mustachetemplate into two parts:http-client.mustacheandapi.mustache
Fixes:
- Fixed unsafe clone() of Response causing json() hang. (Thanks @Benjamin-Dobell)
Features:
--jsCLI option. [feature request]
BREAKING_CHANGES:
- Requests returns
Promise<HttpResponse<Data, Error>>type.
HttpResponseit is Fetch.Response wrapper with fieldsdataanderrorExample:const api = new Api() // const response: HttpResponse<Data, Error> = await api.fruits.getAll() response.data // Data (can be null if response.ok is false) response.error // Error (can be null if response.ok is true)
- Breaking changes in the
client.mustachetemplate. Needs to update local custom templates.
Fixes:
- Security configuration in methods. When the security definition is in the main configuration of the swagger definition
Features:
- Can provide ability to generate from swagger JSON directly not from a file? #69 (Thanks @JennieJi)
Fixes:
- handling
x-omitemptyproperty for definition properties #68 - Additional properties map to empty interfaces (OpenAPI v3) #76
- Pattern fields in Path Item Object are treated as operations #75
- Remove const enum from default template #73
- enums with spaces throw an error #71
Features:
- Improve the naming of model types (#65 issue)
Features:
--templatesCLI option. [feature request]
Provide custommustachetemplates folder which allows to generate custom code (models, Api class, routes)--union-enumsCLI option. [feature request]
Allows to generate all enums as union types.
For example, schema part:will be converted into:"StringEnum": { "enum": ["String1", "String2", "String3", "String4"], "type": "string" }export type StringEnum = "String1" | "String2" | "String3" | "String4";
Fixes:
- Multiple types for a property in Swagger 2 are not handled correctly (#55 issue)
Fixes:
- Generating invalid code in composed schema contexts (#51 issue)
components: schemas: Test: type: object allOf: - type: object properties: x: type: array items: type: string enum: - A-B - type: object properties: y: type: string
export type Test = XAB & { y?: string };
Fixes:
- Broken types for arrays of union types (issue)
Fixes:
- form data request body (request body content
multipart/form-data)
Minor:
- inline comments of the data contract type properties

- remove
Array<T>type usage (now the more simple typeT[])
Features:
- Partially support FormData body types
- Support to generate query params of nested query objects (Partial fix of this issue)
Fixes:
- Critical bug with converting inline object into name of type for request body.
- Fix bug when path parameters is not set but contains in endpoint url.


Breaking Changes:
- Remove
titleandversionpublic Api class properties (moved it to Api class JSDOC)(fixes this issue)

- Move out all http client handlers/properties into
HttpClientlocal class in module


Chore:
- default value for
SecurityDataTypeApi class generic type
Fixes:
- Handling of nullable for $ref in OpenAPI 3.0 (issue)
Plus based on this issue was fixed most other problems with usingrequiredandnullableproperties
Fixes:
- Nullable not included in type definition (issue)
Internal:
- Update
swagger2openapi(6.0.0) dependency
Internal:
- Update
prettier(2.0.2),swagger2openapi(5.4.0) dependencies
Features:
- Improvenment in optional request params (request body, query params, path params)
Fixes:
- Fix bug when
pathrequest param have the same name asquery - Fix bug when
pathrequest param have the same name asparams
Minor/Internal:
- changed
addQueryParams()method - up
swagger2openapidependency version to5.3.4
Features:
Fixes:
- Fix problem with array
typedefinitions withouttypeproperty(#26)
Fixes:
Breaking Changes:
- Rename default typescript output api file name (prev
api.ts, nowApi.ts)
Features: -d, --default-as-successoption. Allows to use "default" status codes as success response type-r, --responsesoption. Response declarations in request rescription
This option adds comments of the possible responses from request

Also typings for.catch()callback

- Improve response body type definitions
- Types for bad responses
Changes: - [minor] fix jsdoc comments space

Features:
- Api module description from schema info

- Generate API type declarations (CLI flag
--route-types, thanks azz)

- Ability to not generate clint API class (CLI flag
--no-client, thanks azz)
Fixes:
- Improve response body type definition
Internal:
- refactored
generateandvalidatetest scripts
Fixes: create api without -o option (use default ./ output)
Features: better naming of routes without operationId

Changes: rename @security true -> @secure, @duplicate true -> @duplicate
Fixes: Support generated swagger schemes from tsoa 3.x with complex types (Omit, Pick, etc)
Features: add .d.ts file into npm package
Changes: update help block in CLI
Internal: add greenkeeper, update npm keywords
Features: @summary, @description comments at each route
Fixes: parsing schema without routes
Changes: update documentation
Internal: add anyOf, allOf test schemas, slack notifications in CI
Fixes: fix complex types (oneOf, anyOf), required fields of object type was not required
Changes: rename ApiParams to RequestParams, secure module always exist in generated API module, update documentation
Fixes: Query params was all required, parse yaml files, typescript minor warnings (;)
Internal: test schemas + manual testing, add travis CI/CD
Fixes: catching http errors with use API module
Features: add description to interfaces and their fields
Changes: update documentation
Changes: update documentation
Changes: update documentation (+ add logo), add comment about author in generated module
Fixes: route naming, http(s) requests for getting swagger schema, integer enums
Changes: include only required files into npm pacakge
Changes: update documentation
Changes: disable linters rules for generated API module
Fixes: TS issues in template
Fixes: NodeJS main script cannot been called on Unix* machines
Changes: add LICENSE, update README
Changes(Internal): change dependencies
New features: query params, separating routes on submodules, common params in constructor, swagger v2 + yaml parsers
Enhancements: better type extracting.
Fixes: mustache escaping chars
Changes: order of request params, emojis messages in console
Initial project.


