-
-
Save effervescentia/4ff7511b1f6a037f98d71b51dacb5012 to your computer and use it in GitHub Desktop.
enum union in failed SDK codegen
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
import { | |
TestControllerBadUnion200ResponseValueOneOf, | |
instanceOfTestControllerBadUnion200ResponseValueOneOf, | |
TestControllerBadUnion200ResponseValueOneOfFromJSON, | |
TestControllerBadUnion200ResponseValueOneOfFromJSONTyped, | |
TestControllerBadUnion200ResponseValueOneOfToJSON, | |
} from './TestControllerBadUnion200ResponseValueOneOf'; | |
import { | |
TestControllerBadUnion200ResponseValueOneOf1, | |
instanceOfTestControllerBadUnion200ResponseValueOneOf1, | |
TestControllerBadUnion200ResponseValueOneOf1FromJSON, | |
TestControllerBadUnion200ResponseValueOneOf1FromJSONTyped, | |
TestControllerBadUnion200ResponseValueOneOf1ToJSON, | |
} from './TestControllerBadUnion200ResponseValueOneOf1'; | |
import { | |
TestControllerBadUnion200ResponseValueOneOf2, | |
instanceOfTestControllerBadUnion200ResponseValueOneOf2, | |
TestControllerBadUnion200ResponseValueOneOf2FromJSON, | |
TestControllerBadUnion200ResponseValueOneOf2FromJSONTyped, | |
TestControllerBadUnion200ResponseValueOneOf2ToJSON, | |
} from './TestControllerBadUnion200ResponseValueOneOf2'; | |
/** | |
* @type TestControllerBadUnion200ResponseValue | |
* | |
* @export | |
*/ | |
export type TestControllerBadUnion200ResponseValue = TestControllerBadUnion200ResponseValueOneOf | TestControllerBadUnion200ResponseValueOneOf1 | TestControllerBadUnion200ResponseValueOneOf2; | |
export function TestControllerBadUnion200ResponseValueFromJSON(json: any): TestControllerBadUnion200ResponseValue { | |
return TestControllerBadUnion200ResponseValueFromJSONTyped(json, false); | |
} | |
export function TestControllerBadUnion200ResponseValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestControllerBadUnion200ResponseValue { | |
if ((json === undefined) || (json === null)) { | |
return json; | |
} | |
return { ...TestControllerBadUnion200ResponseValueOneOfFromJSONTyped(json, true), ...TestControllerBadUnion200ResponseValueOneOf1FromJSONTyped(json, true), ...TestControllerBadUnion200ResponseValueOneOf2FromJSONTyped(json, true) }; | |
} | |
export function TestControllerBadUnion200ResponseValueToJSON(value?: TestControllerBadUnion200ResponseValue | null): any { | |
if (value === undefined) { | |
return undefined; | |
} | |
if (value === null) { | |
return null; | |
} | |
if (instanceOfTestControllerBadUnion200ResponseValueOneOf(value)) { | |
return TestControllerBadUnion200ResponseValueOneOfToJSON(value as TestControllerBadUnion200ResponseValueOneOf); | |
} | |
if (instanceOfTestControllerBadUnion200ResponseValueOneOf1(value)) { | |
return TestControllerBadUnion200ResponseValueOneOf1ToJSON(value as TestControllerBadUnion200ResponseValueOneOf1); | |
} | |
if (instanceOfTestControllerBadUnion200ResponseValueOneOf2(value)) { | |
return TestControllerBadUnion200ResponseValueOneOf2ToJSON(value as TestControllerBadUnion200ResponseValueOneOf2); | |
} | |
return {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment