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

Represent package information in OAS generation when the type is import from different package #6646

Closed
lnash94 opened this issue Jun 20, 2024 · 2 comments

Comments

@lnash94
Copy link
Member

lnash94 commented Jun 20, 2024

Description:

import ballerina/time;

public type User record {
    time:Date birthDate;
    string name?;
    int id;
};

Describe your problem(s)
Generate OAS is missing the information regarding the package this type comes from therefore we need to assign a OAS extension by adding the details.

@TharmiganK
Copy link
Contributor

TharmiganK commented Jul 5, 2024

We could come up with an extension like the below:

x-ballerina-type:
   orgName: ballerina
   packageName: time
   moduleName: time
   version: 2.4.0
   modulePrefix: time

There are few design concerns with adding these information:

  1. These information will be added for all the types including the types in the same package. There can be instances where the types are not public (which is ideally incorrect, but currently ballerina only issues warnings for this). In those scenarios, we should make sure we expose the public ones.
  2. This is useful in ballerina client/service generation since we do not need to generate the predefined types again. But this is just noise for other language generators or users. So it would be better if we generate this only when we give a specific flag

@TharmiganK
Copy link
Contributor

TharmiganK commented Aug 6, 2024

Ballerina to OpenAPI generation now supports ballerina specific type extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests

2 participants