Skip to content

Instantly share code, notes, and snippets.

@markspolakovs
Created December 6, 2020 13:13
Show Gist options
  • Save markspolakovs/afd0bd3cdf6955a90fc1e75f60e166b1 to your computer and use it in GitHub Desktop.
Save markspolakovs/afd0bd3cdf6955a90fc1e75f60e166b1 to your computer and use it in GitHub Desktop.
Repro for openapi-generator issue
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface Listen
*/
export interface Listen {
/**
*
* @type {boolean | string}
* @memberof Listen
*/
classBot?: boolean | string;
}
export function ListenFromJSON(json: any): Listen {
return ListenFromJSONTyped(json, false);
}
export function ListenFromJSONTyped(json: any, ignoreDiscriminator: boolean): Listen {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'classBot': !exists(json, 'class_bot') ? undefined : boolean | stringFromJSON(json['class_bot']),
};
}
export function ListenToJSON(value?: Listen | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'class_bot': boolean | stringToJSON(value.classBot),
};
}
{
"openapi": "3.0.2",
"info": { "title": "FastAPI", "version": "0.1.0" },
"paths": {
"/current": {
"get": {
"summary": "Current Listeners",
"operationId": "current_listeners_current_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Current Listeners Current Get",
"type": "array",
"items": { "$ref": "#/components/schemas/Listen" }
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Listen": {
"title": "Listen",
"required": [
],
"type": "object",
"properties": {
"class_bot": {
"title": "Class Bot",
"anyOf": [{ "type": "boolean" }, { "type": "string" }]
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment