Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated OAS spec need to have require fields for record which has default value in different package #7415

Closed
lnash94 opened this issue Nov 27, 2024 · 1 comment

Comments

@lnash94
Copy link
Member

lnash94 commented Nov 27, 2024

Description

Follow the below example :

Steps to Reproduce

This RollingWindow record belongs to a different package packageA

public type RollingWindow record {|
    decimal timeWindow = 60;
    decimal bucketSize = 10;
|};

if we are using it in the service from another package

...
service / on new http:Listener(7080) {
    resource function get Services() returns packageA:RollingWindow[] {
        return [];
    }
}

The generated OAS includes RollingWindow fields as optional fields, but it should be marked as required since we currently cannot map a default value from a different package.

Version

2201.10.0

Environment Details (with versions)

No response

@TharmiganK
Copy link
Contributor

This is invalid. This is specific to ballerina to spec generation limitations. Even though we don't map the default value, ballerina program will anyway consider this as an optional filed. In that case, it is not correct to consider it as required. Ultimately, when we fix this default value limitation, it should remain as optional field. Hence closing this issue

@github-project-automation github-project-automation bot moved this from In Progress to Done in Ballerina Team Main Board Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants