Skip to content

Fix test failure due to double quotes#1891

Merged
Thevakumar-Luheerathan merged 2 commits into
ballerina-platform:masterfrom
Thevakumar-Luheerathan:fix-openapi
Jun 17, 2026
Merged

Fix test failure due to double quotes#1891
Thevakumar-Luheerathan merged 2 commits into
ballerina-platform:masterfrom
Thevakumar-Luheerathan:fix-openapi

Conversation

@Thevakumar-Luheerathan

@Thevakumar-Luheerathan Thevakumar-Luheerathan commented Jun 17, 2026

Copy link
Copy Markdown
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.

The quoting style change (' → " for $ref values) is coming from SnakeYAML — a transitive dependency of swagger-core. The ballerinaLangVersion bump from 2201.13.0 → 2201.13.4 and latest likely pulled in a newer version of SnakeYAML (or jackson-dataformat-yaml) transitively, which changed how strings starting with # get quoted in YAML output.

This is needed to sync the 2201.13.x PR to master(ballerina-platform/ballerina-lang#44602)

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.

Summary

This PR fixes test failures related to quote handling in OpenAPI schema references by standardizing the formatting of JSON Pointer references across test resource files.

Changes

Dependency Update:

  • Updated gradle.properties to upgrade the Ballerina language version from 2201.13.0 to 2201.13.4

Test Resource Updates:

  • Standardized the formatting of $ref values in OpenAPI YAML test resources across multiple test cases by converting single-quoted JSON Pointer references to double-quoted format
  • Affected test resource files include:
    • response_example/result.yaml
    • project_non_openapi_annotation/result.yaml
    • project_non_openapi_annotation_with_base_path/result.yaml
    • project_non_openapi_annotation_without_base_path/result.yaml
    • project_openapi_bal_ext/result_0.yaml and result_1.yaml
    • project_openapi_examples/result.yaml
    • project_openapi_with_included_test/result.yaml

The quote formatting changes ensure consistency in how schema references are represented across the generated OpenAPI YAML outputs and resolve the underlying test failures.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates OpenAPI integration-test expected outputs to match the current YAML quoting emitted by the toolchain, and bumps the Ballerina language dependency patch version used by the build.

Changes:

  • Update multiple result*.yaml fixtures to use double quotes for $ref values (e.g., "#/components/...") to prevent assertion diffs.
  • Bump ballerinaLangVersion from 2201.13.0 to 2201.13.4 in gradle.properties.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_with_included_test/result.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_examples/result.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_bal_ext/result_1.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_bal_ext/result_0.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation/result.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation_without_base_path/result.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation_with_base_path/result.yaml Updates $ref quoting in expected OpenAPI output fixture.
openapi-integration-tests/src/test/resources/ballerina_sources/examples/response_example/result.yaml Updates $ref quoting in expected OpenAPI output fixture.
gradle.properties Bumps Ballerina language dependency patch version.

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

Comment thread gradle.properties
@sonarqubecloud

Copy link
Copy Markdown

@TharmiganK

Copy link
Copy Markdown
Contributor

@coderabbitai please review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8f6a132-6432-41c4-b8f8-ded8809162bc

📥 Commits

Reviewing files that changed from the base of the PR and between 24da621 and ec5a2f0.

📒 Files selected for processing (9)
  • gradle.properties
  • openapi-integration-tests/src/test/resources/ballerina_sources/examples/response_example/result.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation/result.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation_with_base_path/result.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation_without_base_path/result.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_bal_ext/result_0.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_bal_ext/result_1.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_examples/result.yaml
  • openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_with_included_test/result.yaml

📝 Walkthrough

Walkthrough

Bumps ballerinaLangVersion from 2201.13.0 to 2201.13.4 in gradle.properties and updates nine integration test OpenAPI result YAML files to replace single-quoted $ref strings with double-quoted ones, reflecting the updated YAML serialization output of the new language version.

Changes

Ballerina lang version bump and OpenAPI fixture alignment

Layer / File(s) Summary
Ballerina lang version bump
gradle.properties
ballerinaLangVersion incremented from 2201.13.0 to 2201.13.4.
Integration test result YAML $ref quoting
openapi-integration-tests/src/test/resources/ballerina_sources/examples/response_example/result.yaml, openapi-integration-tests/src/test/resources/ballerina_sources/project_non_openapi_annotation.../result.yaml, openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_bal_ext/result_*.yaml, openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_examples/result.yaml, openapi-integration-tests/src/test/resources/ballerina_sources/project_openapi_with_included_test/result.yaml
All $ref values in response schemas, requestBody schemas, allOf compositions, and component schema definitions changed from single-quoted to double-quoted strings across nine test fixture files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A version bumped, a patch in place,
The quotes all flipped from single face—
Where 'ErrorPayload' once did stay,
Now "ErrorPayload" leads the way!
Hop hop, the YAMLs all agree,
Double quotes bring harmony! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is entirely a template with all required sections unfilled and no actual information provided about the test failure, root cause, or implementation approach. Fill in all required sections with specific details about the test failure, what caused it, how the fix addresses it, and affected test cases and coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: updating test resource files to use double quotes in OpenAPI schema references and updating Ballerina version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details
gh pr view 1891 --repo ballerina-platform/openapi-tools --json title,body,files,additions,deletions,commits

echo "---DIFF---"
gh pr diff 1891 --repo ballerina-platform/openapi-tools

Length of output: 21164


🏁 Script executed:

#!/bin/bash
# Check if there are any remaining result.yaml files that still use single-quoted $ref
rg --type yaml "'\`#/components/`" openapi-integration-tests/ -l

Length of output: 1499



@TharmiganK The changes look correct and complete. Here's a summary of the review:

Review Summary

gradle.properties

The patch version bump from 2201.13.02201.13.4 is the root cause driver — the newer Ballerina lang version changed its YAML serializer to emit double-quoted strings for $ref values instead of single-quoted ones.

result.yaml test fixtures (8 files)

All expected-output files are consistently updated: every $ref: '#/components/schemas/...'$ref: "#/components/schemas/...". Both forms are semantically identical in YAML, so there is no functional regression.

No missed files

The remaining files in the repo that still use single-quoted $ref (e.g., validator/project_*/openapi.yaml, client/project-*/openapi.yaml) are hand-authored input specs, not generated outputs, so they are correctly left unchanged.

The fix is minimal, targeted, and complete. ✅

One minor note: the PR description template sections are all unfilled. Since this is a small test-fixture fix, that's understandable, but a one-liner under Purpose (e.g., "Update test expected outputs to match double-quote $ref serialization introduced in Ballerina lang 2201.13.4") would help future readers trace the change.

[approve]

@TharmiganK TharmiganK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes looks good to me. Please update the PR with proper title and description

@Thevakumar-Luheerathan Thevakumar-Luheerathan merged commit b635761 into ballerina-platform:master Jun 17, 2026
5 checks passed
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