Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fmvilas committed Oct 13, 2022
1 parent 5f3c1be commit 46889bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/models/v3/asyncapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class AsyncAPIDocument extends BaseModel<v3.AsyncAPIObject> implements As
operations() {
const operations: OperationInterface[] = Object.entries(this._json.operations || {}).map(([operationId, operation]) =>
this.createModel(Operation, operation, { id: operationId, address: operationId, pointer: `/operations/${tilde(operationId)}` })
)
);

return new Operations(operations);
}
Expand Down
5 changes: 2 additions & 3 deletions src/models/v3/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ChannelParameters } from '../channel-parameters';
import { ChannelParameter } from './channel-parameter';
import { Messages } from '../messages';
import { Operations } from '../operations';
import { Operation } from './operation';
import { Servers } from '../servers';
import { Server } from './server';

Expand All @@ -16,7 +15,7 @@ import type { ExtensionsInterface } from '../extensions';
import type { MessagesInterface } from '../messages';
import type { MessageInterface } from '../message';
import type { OperationsInterface } from '../operations';
import type { OperationAction, OperationInterface } from '../operation';
import type { OperationInterface } from '../operation';
import type { ServersInterface } from '../servers';
import type { ServerInterface } from '../server';

Expand Down Expand Up @@ -44,7 +43,7 @@ export class Channel extends BaseModel<v3.ChannelObject, { id: string, address?:
if (Array.isArray(this._json.servers)) {
allowedServers = this._json.servers || [];
} else {
const parsedAsyncAPI = this._meta.asyncapi!.parsed as v3.AsyncAPIObject
const parsedAsyncAPI = this._meta.asyncapi.parsed as v3.AsyncAPIObject;
allowedServers = parsedAsyncAPI.servers || [];
}
const servers: ServerInterface[] = allowedServers.map((server: v3.ServerObject) => new Server(server));
Expand Down
2 changes: 1 addition & 1 deletion src/models/v3/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class Server extends BaseModel<v3.ServerObject, { id: string }> implement
operationsData.push(op.json());
}
});
})
});
return new Operations(operations);
}

Expand Down
4 changes: 2 additions & 2 deletions src/spec-types/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export interface OperationObject extends SpecificationExtensions {
externalDocs?: ExternalDocumentationObject;
bindings?: OperationBindingsObject | ReferenceObject;
traits?: OperationTraitObject[];
};
}

export interface OperationTraitObject extends SpecificationExtensions {
action?: string;
Expand All @@ -126,7 +126,7 @@ export interface OperationTraitObject extends SpecificationExtensions {
tags?: TagsObject;
externalDocs?: ExternalDocumentationObject;
bindings?: OperationBindingsObject | ReferenceObject;
};
}

export type TagsObject = Array<TagObject>;

Expand Down

0 comments on commit 46889bf

Please sign in to comment.