Skip to content

Instantly share code, notes, and snippets.

@vadjs
Last active February 28, 2020 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadjs/d66c310a13c1466280fd0dfebbd00634 to your computer and use it in GitHub Desktop.
Save vadjs/d66c310a13c1466280fd0dfebbd00634 to your computer and use it in GitHub Desktop.
ng-openapi-gen broken respose types
export class ContractTypesService extends BaseService {
contractTypesGet$Json$ResponseOLD(params?: {
}): Observable<StrictHttpResponse<{ [key: string]: string }>> {
const rb = new RequestBuilder(this.rootUrl, ContractTypesService.ContractTypesGetPath, 'get');
if (params) {
}
return this.http.request(rb.build({
// FIXME: PROBLEM IS HERE
responseType: 'json',
accept: 'application/json'
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<{ [key: string]: string }>;
})
);
}
contractTypesGet$Json$ResponseNEW(params?: {
}): Observable<StrictHttpResponse<{ [key: string]: string }>> {
const rb = new RequestBuilder(this.rootUrl, ContractTypesService.ContractTypesGetPath, 'get');
if (params) {
}
return this.http.request(rb.build({
// FIXME: PROBLEM IS HERE
responseType: 'text',
accept: 'text/json'
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<{ [key: string]: string }>;
})
);
}
}
{
"openapi": "3.0.1",
"info": {
"title": "Enumeration API",
"version": "v1"
},
"servers": [
{
"url": "http://localhost"
}
],
"paths": {
"/Countries": {
"get": {
"tags": [
"Countries"
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"text/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
}
},
"components": { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment