Skip to content

Conversation

@vikasrathee-cs
Copy link
Contributor

@vikasrathee-cs vikasrathee-cs commented Jul 17, 2025

[PLUGIN-1902 Changes done for schema backward compatibility along with metadata API addition for DTS](#100)

@vikasrathee-cs vikasrathee-cs force-pushed the backward-compatability-schema-fix branch from b24f5ed to fa9c399 Compare July 17, 2025 05:42
@vikasrathee-cs vikasrathee-cs requested a review from prince-cs July 18, 2025 05:47
@vikasrathee-cs vikasrathee-cs force-pushed the backward-compatability-schema-fix branch from 4ac51bd to a69805b Compare July 18, 2025 07:56
@vikasrathee-cs vikasrathee-cs force-pushed the backward-compatability-schema-fix branch from a69805b to a3b768a Compare July 25, 2025 12:16
@vikasrathee-cs vikasrathee-cs force-pushed the backward-compatability-schema-fix branch from a3b768a to e5f72f3 Compare August 4, 2025 09:54
@sahusanket
Copy link

Any reason why model is inside sink ? Is it not used by validation and source?

If no strong reason then please refactor it to io.cdap.plugin.servicenow.model

@sahusanket
Copy link

I see a lot of Old code that was used for SCHEMA API , is not used to MetaData APi instead ?

Is that expected? and why ?

@vikasrathee-cs
Copy link
Contributor Author

I see a lot of Old code that was used for SCHEMA API , is not used to MetaData API instead ?
Is that expected? and why ?

Previously Schema API was removed and same classes were used for Metadata API, later due to backward compatibility we had to add schema api again. Renamed the classes again to provide the clarity on which class getting used by which api.


if (schemaResponse.getResult() == null && schemaResponse.getResult().getColumns().isEmpty()) {
throw new RuntimeException("Error - Schema Response does not contain any result");
if (schemaType == SchemaType.METADATA_API_BASED) {

Choose a reason for hiding this comment

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

In case of DTS it directly calls this method ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

SchemaType schemaType) {
if (isSchemaRequired) {
this.setUrl(String.format(METADATA_API_URL_TEMPLATE, instanceBaseUrl, tableName));
if (SchemaType.METADATA_API_BASED == schemaType) {

Choose a reason for hiding this comment

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

Please simplify this

move this.setUrl(String.format(TABLE_API_URL_TEMPLATE, instanceBaseUrl, tableName)); before the if block as the default

public ServiceNowTableAPIClientImpl(ServiceNowConnectorConfig conf) {
public ServiceNowTableAPIClientImpl(ServiceNowConnectorConfig conf, Boolean useConnection) {
this.conf = conf;
this.useConnection = useConnection;

Choose a reason for hiding this comment

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

Do we still need this field ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, removed.

@sahusanket
Copy link

Please squash before merging.

@vikasrathee-cs vikasrathee-cs force-pushed the backward-compatability-schema-fix branch from f7c5bc7 to 4af230c Compare August 21, 2025 07:53
@vikasrathee-cs vikasrathee-cs merged commit 1ad8412 into develop Aug 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants