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
Since checkAndRenameModelName will find a hyphen in the described situation, Lodash's startCase function and whitespace removal is executed on the whole subtype, causing distortions in the output as shown below (undesired casing, missing punctuation and missing spacing). It might be a sufficient fix to just remove the checkAndRenameModelName there.
The text was updated successfully, but these errors were encountered:
jabrandes
changed the title
Bug: Corner-Case generating invalid code in polymorphic contexts
Bug: Generating invalid code in composed schema contexts
Jun 11, 2020
An invalid Typescript type is generated in contexts where all of the following criteria are met:
allOf
specificationallOf
contains at least two type specificationsallOf
types contains an array property ofenum
values-
)I suspect the issue to be the following code snippet:
swagger-typescript-api/src/typeFormatters.js
Lines 31 to 37 in acc770b
Since
checkAndRenameModelName
will find a hyphen in the described situation, Lodash'sstartCase
function and whitespace removal is executed on the whole subtype, causing distortions in the output as shown below (undesired casing, missing punctuation and missing spacing). It might be a sufficient fix to just remove thecheckAndRenameModelName
there.Swagger specification for reproduction
Generated code
The text was updated successfully, but these errors were encountered: