Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bin/configs/typescript-fetch-infinite-recursion-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
generatorName: typescript-fetch
outputDir: samples/client/others/typescript-fetch/infinite-recursion-issue
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
additionalProperties:
enumPropertyNaming: "original"
enumUnknownDefaultCase: true
Original file line number Diff line number Diff line change
Expand Up @@ -1605,11 +1605,13 @@ public ExtendedCodegenModel(CodegenModel cm) {
if (this.discriminator != null) {
Set<CodegenDiscriminator.MappedModel> mappedModels = this.discriminator.getMappedModels();
for(CodegenDiscriminator.MappedModel mappedModel : mappedModels) {
if(mappedModel.getModelName().equals(cm.classname)){
this.discriminator.getMappedModels().remove(mappedModel);
this.selfReferencingDiscriminatorMapping=mappedModel;
if(mappedModel.getModelName().equals(cm.classname)) {
this.selfReferencingDiscriminatorMapping = mappedModel;
}
}
if(this.selfReferencingDiscriminatorMapping != null) {
this.discriminator.getMappedModels().remove(this.selfReferencingDiscriminatorMapping);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
openapi: 3.0.3
info:
title: Minimal
description: Api to reproduce bug
version: 0.5.1-SNAPSHOT.0
tags:
- name: test
servers:
- url: http://localhost:8080
paths:
/api/v1/test:
get:
tags:
- test
operationId: test
responses:
"200":
description: test operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/TestBaseDto"

components:
schemas:
TestObjectType:
type: string
enum:
- TEST1
- TEST2
TestBaseDto:
type: object
properties:
something:
type: string
testObjectType:
$ref: "#/components/schemas/TestObjectType"
discriminator:
propertyName: testObjectType
mapping:
TEST2: '#/components/schemas/ExtendDto'
TEST1: '#/components/schemas/TestBaseDto'
ExtendDto:
allOf:
- $ref: '#/components/schemas/TestBaseDto'
- type: object
properties:
someItems:
type: array
items:
$ref: '#/components/schemas/TestBaseDto'

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions samples/client/echo_api/typescript/build/docs/AuthApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading