0

I used Swagger to generate client stub (to call API), this part is fine. When I try to import the class in a component I am getting the error Module has no member of ...

import { CollaborationClient } from './../../shared/web-api-client';

Getting error on on above statement.

web-api-client.ts (file generated by Swagger) has CollaborationClient as below

export interface ICollaborationClient {
        get(): Observable<any>;
        updateCollaborationInfo(collaboration: CollaborationViewModel): Observable<any>;
        createCollaboration(collaboration: CollaborationViewModel): Observable<any>;
        removeCollaborationMember(collaboration: CollaborationViewModel): Observable<any>;
        put(id: number, member: UserViewModel): Observable<any>;
        delete(id: number): Observable<any>;
    }


@Injectable()
export class CollaborationClient implements ICollaborationClient {
    private http: Http = null; 
    private baseUrl: string = undefined; 
    protected jsonParseReviver: (key: string, value: any) => any = undefined;

    constructor(@Inject(Http) http: Http, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
        this.http = http; 
        this.baseUrl = baseUrl ? baseUrl : ""; 
    }
Sami
  • 3,686
  • 4
  • 17
  • 28

1 Answers1

0

If you used NSwagStudio, check if you accidentally put something in the "Module name" field.

Whosdatdev
  • 333
  • 3
  • 10