Skip to content

Comments

Generate JSON schema dynamically at runtime#21

Merged
SasinduDilshara merged 8 commits intoballerina-platform:test-runtime-schmefrom
chiranSachintha:union-type
Mar 18, 2025
Merged

Generate JSON schema dynamically at runtime#21
SasinduDilshara merged 8 commits intoballerina-platform:test-runtime-schmefrom
chiranSachintha:union-type

Conversation

@chiranSachintha
Copy link
Member

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.89%. Comparing base (f9b959b) to head (a1d8dde).
Report is 11 commits behind head on test-runtime-schme.

❌ 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                   @@
##           test-runtime-schme      #21      +/-   ##
======================================================
- 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.

@chiranSachintha chiranSachintha changed the title Generate JSON schema for union types Generate JSON schema dynamically at runtime Mar 13, 2025
@SasinduDilshara SasinduDilshara changed the base branch from main to test-runtime-schme March 18, 2025 04:18
@SasinduDilshara
Copy link
Contributor

Got the ballerina-platform/ballerina-library#7704 issue

@SasinduDilshara SasinduDilshara merged commit d39a920 into ballerina-platform:test-runtime-schme Mar 18, 2025
3 of 4 checks passed
}

@Override
public FunctionCallExpressionNode transform(FunctionCallExpressionNode functionCallExpressionNode) {
Copy link
Member

Choose a reason for hiding this comment

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

Why didn't we do this only for np:callLlm calls?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean to special case only for np:callLlm, right? There's no issue with the current implementation, right?it's to analyze all function calls.

Copy link
Member

Choose a reason for hiding this comment

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

Aren't we unnecessarily generating JSON schema with function calls that are not relevant to NP?

E.g.,

import ballerinax/np; // used elsewhere in the file, but no reference to IntArray

type IntArray int[];

function getArr() returns IntArray => [1, 2];

IntArray x = getArr();

Copy link
Member

Choose a reason for hiding this comment

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

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