-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeScript-Fetch] Generate oneOf schemas as type unions (#2617)
* Generate oneOf schemas as type unions for typescript-fetch * Adjust oneOf imports to only include refs of oneOf
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{#hasImports}} | ||
import { | ||
{{#imports}} | ||
{{{.}}}, | ||
{{/imports}} | ||
} from './'; | ||
|
||
{{/hasImports}} | ||
/** | ||
* @type {{classname}}{{#description}} | ||
* {{{description}}}{{/description}} | ||
* @export | ||
*/ | ||
export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters