Skip to content

Conversation

@yyin-talend
Copy link
Collaborator

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

What does this PR adds (design/code thoughts)?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds JSON deserialization capability for Schema and Entry models, enabling the component server to parse JSON representations into Schema instances. The changes support comprehensive schema definition including all data types, nested structures, metadata entries, and logical types.

Changes:

  • Added Schema and Entry model classes with Jackson deserialization support
  • Implemented comprehensive test coverage for all schema types and field parameters
  • Moved component-server-api dependency to test scope and added jackson-databind for testing

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Schema.java New model class representing schema structure with type, entries, metadata, and properties
Entry.java New model class representing schema entry with support for nested schemas and typed default values
SchemaTest.java Comprehensive test suite covering serialization/deserialization of all schema types and configurations
EntryTest.java Unit tests for Entry class including JSON deserialization and accessor methods
pom.xml Dependency reorganization moving component-server-api to test scope and adding jackson-databind

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +56
public String getProp(final String key) {
return this.props.get(key);
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The getProp method will throw NullPointerException if props is null. Add a null check before accessing props, or ensure props is never null in the constructor.

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +81
private Object getInternalDefaultValue() {
return defaultValue;
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The getInternalDefaultValue method appears to be a simple getter for the defaultValue field. Consider removing this method and accessing the field directly in getDefaultValue() to reduce unnecessary indirection.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@ypiel-talend ypiel-talend left a comment

Choose a reason for hiding this comment

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

Some minor changes requested

</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-api</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why it has been moved ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure the reason. but it just moved from line 66 to line 189...

</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this dependency

@sonar-eks
Copy link

sonar-eks bot commented Jan 20, 2026

Failed Quality Gate failed

  • 0.00% Coverage on New Code (is less than 80.00%)
  • 2 New Issues (is greater than 0)

Project ID: org.talend.sdk.component:component-runtime

View in SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants