ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
137 stars 58 forks source link

Integer default value is not mapped in the generated OpenAPI specification #6950

Closed TharmiganK closed 3 weeks ago

TharmiganK commented 3 weeks ago

Description:

$Subject

Identified while testing this issue: https://github.com/ballerina-platform/ballerina-library/issues/6948

Steps to reproduce:

Try to generate the OpenAPI specification for the following service contract type:

import ballerina/http;

public type Genre record {|
    string name;
    string description;
|};

public type Album record {|
    int iid = -1;
    string title;
    string author;
    Genre genre = {
        name: "Unknown",
        description: "Unknown"
    };
|};

type AlbumService service object {
    *http:ServiceContract;

    resource function get albums/[string id]() returns Album;
};
$ bal openapi -i service.bal

This gives a warning saying that the default value for Album.iid is not mapped in the generated OpenAPI specification

Affected Versions:

Ballerina SwanLake Update 10(2201.10.x)

github-actions[bot] commented 3 weeks ago

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.