Skip to content

Commit

Permalink
Remove 'success' property from all commands
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-rr committed Jan 10, 2024
1 parent 4660169 commit ab22337
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/commands/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class Bundle extends Command {

// Metrics recording.
this.specFile = await load(output);
this.metricsMetadata = {success: true, files: AsyncAPIFiles.length};
this.metricsMetadata = {files: AsyncAPIFiles.length};
}

async loadFiles(filepaths: string[]): Promise<Specification[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class Convert extends Command {
}

// Metrics recording.
let metadata: MetricMetadata = {success: true, to_version: flags['target-version']};
let metadata: MetricMetadata = {to_version: flags['target-version']};
try {
const {document} = await this.parser.parse(specFile.text());
if (document !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/generate/fromTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default class Template extends Command {

// Metrics recording.
this.specFile = asyncapiInput;
this.metricsMetadata = {success: true, template};
this.metricsMetadata = {template};
}

private parseFlags(disableHooks?: string[], params?: string[], mapBaseUrl?: string): ParsedFlags {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class Optimize extends Command {

// Metrics recording.
this.specFile = await load(filePath);
this.metricsMetadata = {success: true, optimizations: this.optimizations};
this.metricsMetadata = {optimizations: this.optimizations};
}

private showOptimizations(elements: ReportElement[] | undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ export default class Validate extends Command {

// Metrics recording.
this.specFile = await load(filePath);
this.metricsMetadata = {success: true, validation_result: result};
this.metricsMetadata = {validation_result: result};
}
}

0 comments on commit ab22337

Please sign in to comment.