Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANGULAR] Bug generating typescript-angular client #9971

Closed
BaptisteCyrill opened this issue Jan 11, 2020 · 6 comments
Closed

[ANGULAR] Bug generating typescript-angular client #9971

BaptisteCyrill opened this issue Jan 11, 2020 · 6 comments

Comments

@BaptisteCyrill
Copy link

Description

I created a swagger documentation online (http://editor.swagger.io) and generate a typescript-angular client. In this client I found the following issues:

  • Missing quotation marks on http methods
  • Missing comma behind body: body
Swagger-codegen version

3.0.15 online (http://editor.swagger.io)

Swagger declaration file content or url
openapi: 3.0.2
info:
  title: Customer Management Service
  version: '1.0'
servers:
  - url: 'http://localhost:8086'
paths:
  '/v1/admin/countries/{key}':
    put:
      tags:
        - customer-mgmt-country-admin-v1
      summary: Updates a country.
      description: ''
      operationId: updateCountry
      parameters:
        - $ref: '#/components/parameters/key'
      requestBody:
        $ref: '#/components/requestBodies/CountryBody'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
components:
  schemas:
    Country:
      type: object
      properties:
        key:
          type: string
          minLength: 2
          maxLength: 2
          pattern: '^[A-Z]{2}$'
          example: DE
          description: A unique object key in ISO 3166-ALPHA-2 format.
      required:
        - key
  parameters:
    key:
      name: key
      in: path
      description: The functional key of the type.
      required: true
      schema:
        type: string
  requestBodies:
    CountryBody:
      description: A JSON object containing the translated country.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Country'
Steps to reproduce
  • Paste the yaml above in editor on http://editor.swagger.io/
  • Use menu item 'Generate client | typescript-angular'
  • Open the file /api/customerMgmtCountryAdminV1.service.ts in the generated zip-file
  • See the errors in line 99 and line 101
@mold
Copy link

mold commented Jan 13, 2020

It's been fixed in a PR waiting to get merged 🙏 swagger-api/swagger-codegen-generators#576

@cmalard
Copy link

cmalard commented Jan 13, 2020

@HugoMario can you help on the merging ? :beers: :vulcan_salute:

@HugoMario
Copy link
Contributor

@cmalard , of course!!

@ghost
Copy link

ghost commented Jan 15, 2020

Any news when this will get released / deployed?

@HugoMario
Copy link
Contributor

@tsproesser , it will be released this week, probably today

@HugoMario
Copy link
Contributor

PR merged, closing now, will release soon. thanks everyone!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants