Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions schemaregistry/rest-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { OAuthClient } from './oauth/oauth-client';
import { RestError } from './rest-error';
import axiosRetry from "axios-retry";
import { fullJitter, isRetriable, isSuccess } from './retry-helper';
import { version } from './package.json';
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing directly from package.json may fail at runtime depending on the TypeScript configuration. Consider using require() or ensure resolveJsonModule is enabled in tsconfig.json. Alternatively, use a dynamically imported version constant to avoid potential compilation issues.

Suggested change
import { version } from './package.json';
const { version } = require('./package.json');

Copilot uses AI. Check for mistakes.
/*
* Confluent-Schema-Registry-TypeScript - Node.js wrapper for Confluent Schema Registry
*
Expand Down Expand Up @@ -76,6 +77,7 @@ export class RestService {
}
this.setHeaders({ 'Content-Type': 'application/vnd.schemaregistry.v1+json' });
this.setHeaders({ 'Confluent-Accept-Unknown-Properties': 'true' });
this.setHeaders({ 'Confluent-Client-Version': `javascript/${version}` });

this.handleBasicAuth(basicAuthCredentials);
this.handleBearerAuth(maxRetries ?? 2, retriesWaitMs ?? 1000, retriesMaxWaitMs ?? 20000, bearerAuthCredentials);
Expand Down