Add runtime Json schema generation#39
Conversation
…allerinax-np into union-type # Conflicts: # ballerina/Dependencies.toml
Generate JSON schema dynamically at runtime
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ 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. 🚀 New features to boost your workflow:
|
| test:assertTrue((<error> rating).message().includes(ERROR_MESSAGE)); | ||
| } | ||
|
|
||
| type Foo record{| string name; |}; |
There was a problem hiding this comment.
Please use an appropriate name instead of Foo.
|
|
||
| private final ModifierData modifierData; | ||
| private final CodeModifier.AnalysisData analysisData; | ||
| private static CodeModifier.AnalysisData analysisData; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
How is this correct when this function can get called concurrently?!
| isSchemaGeneratedAtCompileTime ? jsonSchema : null); | ||
| } | ||
|
|
||
| public static Object generateJsonSchemaForType(Type td) { |
There was a problem hiding this comment.
Could have added tests for this runtime schema generation.
$Subject