You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subPortfolio and combinedPortfolio has Portfolio type in Portfolio definition in YAML file. I have tried to generate the code with latest swagger-codegen-cli-3.0.46.jar, Portfolio type should be in import section but not added. Why Portfolio type not adding to module.exports, define and root.xxxx.api section.
Tested Java code and code generated as expected. Is self $ref not supported for Javascript ?
The text was updated successfully, but these errors were encountered:
JS code generator not working
Swagger.yaml:
`openapi: 3.0.1
info:
title: Test API
version: "1.0"
servers:
security:
components:
schemas:
Portfolio:
allOf:
- $ref: '#/components/schemas/DlResource'
- type: object
properties:
name:
type: string
description:
type: string
isArchived:
type: boolean
baselinePortfolioPlanUser:
$ref: '#/components/schemas/PortfolioPlanUser'
fields:
$ref: '#/components/schemas/Fields'
projects:
$ref: '#/components/schemas/Projects'
portfolioPlans:
$ref: '#/components/schemas/PortfolioPlans'
portfolioPlanUsers:
$ref: '#/components/schemas/PortfolioPlanUsers'
attributes:
$ref: '#/components/schemas/Attributes'
isCombined:
type: boolean
userRegistrationToken:
type: string
description: user registration token string
subPortfolios:
$ref: '#/components/schemas/Portfolio'
combinedPortfolios:
$ref: '#/components/schemas/Portfolio'
resourcePools:
$ref: '#/components/schemas/ResourcePools'
totalBudget:
type: number
format: double
default: 0.0
newNotificationsCount:
type: integer
customNames:
$ref: '#/components/schemas/CustomNames'`
Generated code:
(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['ApiClient', 'model/Attributes', 'model/CustomNames', 'model/DlResource', 'model/Fields', 'model/PortfolioPlanUser', 'model/PortfolioPlanUsers', 'model/PortfolioPlans', 'model/Projects', 'model/ResourcePools'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./Attributes'), require('./CustomNames'), require('./DlResource'), require('./Fields'), require('./PortfolioPlanUser'), require('./PortfolioPlanUsers'), require('./PortfolioPlans'), require('./Projects'), require('./ResourcePools')); } else { // Browser globals (root is window) if (!root.DecisionLensApi) { root.DecisionLensApi = {}; } root.DecisionLensApi.Portfolio = factory(root.DecisionLensApi.ApiClient, root.DecisionLensApi.Attributes, root.DecisionLensApi.CustomNames, root.DecisionLensApi.DlResource, root.DecisionLensApi.Fields, root.DecisionLensApi.PortfolioPlanUser, root.DecisionLensApi.PortfolioPlanUsers, root.DecisionLensApi.PortfolioPlans, root.DecisionLensApi.Projects, root.DecisionLensApi.ResourcePools); } }(this, function(ApiClient, Attributes, CustomNames, DlResource, Fields, PortfolioPlanUser, PortfolioPlanUsers, PortfolioPlans, Projects, ResourcePools) { 'use strict';
Expected code:
(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['ApiClient', 'model/Attributes', 'model/Portfolio', 'model/CustomNames', 'model/DlResource', 'model/Fields', 'model/PortfolioPlanUser', 'model/PortfolioPlanUsers', 'model/PortfolioPlans', 'model/Projects', 'model/ResourcePools'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./Portfolio'), require('./Attributes'), require('./CustomNames'), require('./DlResource'), require('./Fields'), require('./PortfolioPlanUser'), require('./PortfolioPlanUsers'), require('./PortfolioPlans'), require('./Projects'), require('./ResourcePools')); } else { // Browser globals (root is window) if (!root.DecisionLensApi) { root.DecisionLensApi = {}; } root.DecisionLensApi.Portfolio = factory(root.DecisionLensApi.ApiClient, root.DecisionLensApi.Portfolio, root.DecisionLensApi.Attributes, root.DecisionLensApi.CustomNames, root.DecisionLensApi.DlResource, root.DecisionLensApi.Fields, root.DecisionLensApi.PortfolioPlanUser, root.DecisionLensApi.PortfolioPlanUsers, root.DecisionLensApi.PortfolioPlans, root.DecisionLensApi.Projects, root.DecisionLensApi.ResourcePools); } }(this, function(ApiClient, Attributes, CustomNames, DlResource, Fields, Portfolio, PortfolioPlanUser, PortfolioPlanUsers, PortfolioPlans, Projects, ResourcePools) { 'use strict';
subPortfolio and combinedPortfolio has Portfolio type in Portfolio definition in YAML file. I have tried to generate the code with latest swagger-codegen-cli-3.0.46.jar, Portfolio type should be in import section but not added. Why Portfolio type not adding to module.exports, define and root.xxxx.api section.
Tested Java code and code generated as expected. Is self $ref not supported for Javascript ?
The text was updated successfully, but these errors were encountered: