Fixes:
name.includes is not a function
(issue #98)
Features:
--moduleNameIndex
option. 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.mustache
client.mustache
->http.client.mustache
+api.mustache
- Split the
client.mustache
template into two parts:http-client.mustache
andapi.mustache
Fixes:
- Fixed unsafe clone() of Response causing json() hang. (Thanks @Benjamin-Dobell)
Features:
--js
CLI option. [feature request]
BREAKING_CHANGES:
- Requests returns
Promise<HttpResponse<Data, Error>>
type.
HttpResponse
it is Fetch.Response wrapper with fieldsdata
anderror
Example: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.mustache
template. 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-omitempty
property 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:
--templates
CLI option. [feature request]
Provide custommustache
templates folder which allows to generate custom code (models, Api class, routes)--union-enums
CLI 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
title
andversion
public Api class properties (moved it to Api class JSDOC)(fixes this issue)
- Move out all http client handlers/properties into
HttpClient
local class in module
Chore:
- default value for
SecurityDataType
Api 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 usingrequired
andnullable
properties
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
path
request param have the same name asquery
- Fix bug when
path
request param have the same name asparams
Minor/Internal:
- changed
addQueryParams()
method - up
swagger2openapi
dependency version to5.3.4
Features:
Fixes:
- Fix problem with array
type
definitions withouttype
property(#26)
Fixes:
Breaking Changes:
- Rename default typescript output api file name (prev
api.ts
, nowApi.ts
)
Features: -d, --default-as-success
option. Allows to use "default" status codes as success response type-r, --responses
option. 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
generate
andvalidate
test 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.