Skip to content

Releases: acacode/swagger-typescript-api

3.1.2 Release

07 Jan 08:45
4a5d7ea
Compare
Choose a tag to compare

Fixes:

3.1.1 Release

23 Dec 11:16
9781aff
Compare
Choose a tag to compare

Fixes:

  • name.includes is not a function (issue #98)

3.1.0 Release

21 Dec 08:17
14f59aa
Compare
Choose a tag to compare

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

3.0.0 Release

10 Nov 09:51
1f6e21b
Compare
Choose a tag to compare

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 and api.mustache

Fixes:

  • Fixed unsafe clone() of Response causing json() hang. (Thanks @Benjamin-Dobell)

2.0.0 Release

28 Oct 06:38
9329559
Compare
Choose a tag to compare

Features:

BREAKING_CHANGES:

  • Requests returns Promise<HttpResponse<Data, Error>> type.
    HttpResponse it is Fetch.Response wrapper with fields data and error
    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

1.12.0 Release

19 Aug 21:26
a163999
Compare
Choose a tag to compare

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

1.11.0 release

13 Jul 22:17
7a23584
Compare
Choose a tag to compare

Features:

  • Improve the naming of model types (#65 issue)

1.10.0 release

26 Jun 22:00
4b0ace2
Compare
Choose a tag to compare

Features:

  • --templates CLI option. [feature request]
    Provide custom mustache 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:
    "StringEnum": {
      "enum": ["String1", "String2", "String3", "String4"],
      "type": "string"
    }
    
    will be converted into:
    export type StringEnum = "String1" | "String2" | "String3" | "String4";

1.8.4 release

17 Jun 23:12
8db5766
Compare
Choose a tag to compare

Fixes:

  • Multiple types for a property in Swagger 2 are not handled correctly (#55 issue)

1.8.3 release

14 Jun 22:56
dcb2dd2
Compare
Choose a tag to compare

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