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
openapi generates a valid services/DefaultService.ts:
/* generated using openapi-typescript-codegen -- do no edit *//* istanbul ignore file *//* tslint:disable *//* eslint-disable */import{Injectable}from'@angular/core';import{HttpClient}from'@angular/common/http';importtype{Observable}from'rxjs';importtype{MySQL}from'../models/MySQL';import{OpenAPI}from'../core/OpenAPI';import{requestas__request}from'../core/request';
@Injectable({providedIn: 'root',})exportclassDefaultService{constructor(publicreadonlyhttp: HttpClient){}/** * Create MySQL resource * @param requestBody * @returns MySQL Created * @throws ApiError */publicpostDatabaseMysql(requestBody?: MySQL,): Observable<MySQL>{return__request(OpenAPI,this.http,{method: 'POST',url: '/mysql',body: requestBody,mediaType: 'application/json',});}}
Code with bug
I attached archive openapi-reproduce.zip with valid (without external $ref) and invalid (with external $ref) code. Archive contains openapi-broken project with bug and external $ref, and openapi-valid without bug and external $ref
The text was updated successfully, but these errors were encountered:
Problem
openapi.yaml
spec file has relative references to schemasschemas/MySQL.yaml
file (but in our case it doesn't matter):openapi
call generates an invalid Angular client for API:services/DefaultService.ts
is broken:MySQL
model haspaths_1mysql_post_requestBody_content_application_1json_schema
name and that model does't exist (model directory is empty).Without external refs
If i use local ref instead of external everything works fine:
openapi generates a valid
services/DefaultService.ts
:Code with bug
I attached archive openapi-reproduce.zip with valid (without external
$ref
) and invalid (with external$ref
) code. Archive containsopenapi-broken
project with bug and external$ref
, andopenapi-valid
without bug and external$ref
The text was updated successfully, but these errors were encountered: