Skip to content

Comments

Add runtime Json schema generation#39

Merged
SasinduDilshara merged 9 commits intomainfrom
test-runtime-schme
Mar 18, 2025
Merged

Add runtime Json schema generation#39
SasinduDilshara merged 9 commits intomainfrom
test-runtime-schme

Conversation

@SasinduDilshara
Copy link
Contributor

$Subject

@codecov
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.89%. Comparing base (6d4d418) to head (d39a920).
Report is 10 commits behind head on main.

❌ Your project status has failed because the head coverage (69.89%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   72.58%   69.89%   -2.69%     
==========================================
  Files           6        6              
  Lines         186      186              
  Branches       53       53              
==========================================
- Hits          135      130       -5     
- Misses         51       56       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SasinduDilshara SasinduDilshara merged commit 25aa28f into main Mar 18, 2025
3 of 4 checks passed
@MaryamZi MaryamZi deleted the test-runtime-schme branch March 25, 2025 16:48
test:assertTrue((<error> rating).message().includes(ERROR_MESSAGE));
}

type Foo record{| string name; |};
Copy link
Member

Choose a reason for hiding this comment

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

Please use an appropriate name instead of Foo.


private final ModifierData modifierData;
private final CodeModifier.AnalysisData analysisData;
private static CodeModifier.AnalysisData analysisData;
Copy link
Member

Choose a reason for hiding this comment

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

Why was this changed? Why can't this be used similar to modifierData?

Note the warnings also - Static member 'io.ballerina.lib.np.compilerplugin.PromptAsCodeCodeModificationTask.analysisData' accessed via instance reference

*/
public class Native {

static Boolean isSchemaGeneratedAtCompileTime;
Copy link
Member

Choose a reason for hiding this comment

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

How is this correct when this function can get called concurrently?!

isSchemaGeneratedAtCompileTime ? jsonSchema : null);
}

public static Object generateJsonSchemaForType(Type td) {
Copy link
Member

Choose a reason for hiding this comment

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

Could have added tests for this runtime schema generation.

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