[BUG] Javascript babel, weird output for comment block
Created by: jdorel
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
Using the javascript client module, when using npm run build
, the first block comment in the files in src
get distorted with a lot of blank spaces and renders navigation of the code really slow.
Initial block comment:
/**
* Custom API
* Custom API
*
* OpenAPI spec version: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
Block comment modified by babel and code added:
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
* Custom API
* Custom API
*
* OpenAPI spec version: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
Removing the .babelrc
appears to prevent this distorsion.
openapi-generator version
4.0.0-beta3
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: Custom API
description: Custom API
version: 0.0.1
servers:
- url: "/api/v1"
paths:
/custom:
get:
summary: Returns a custom object
operationId: app.custom
responses:
'200':
description: Custom found
content:
application/json:
schema:
$ref: '#/components/schemas/object'
'404':
description: Custom not found
components:
schemas:
object:
description: Custom value
type: number
Command line used for generation
npx openapi-generator generate --skip-validate-spec -i custom.yml -g javascript -o custom_api_javascript
Steps to reproduce
After generating the module:
cd custom_api_javascript
npm install
npm run build
Related issues/PRs
None
Suggest a fix
Remove .babelrc
, but it might be used for other things.