ballerina-platform / ballerina-library

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

Parameterize the generated file names #7278

Open KavinduZoysa opened 1 month ago

KavinduZoysa commented 1 month ago

Description: When we generate the service object type in the open API tool, it always generates the 2 files called service_contract.bal and types.bal. We need to parameterize these file names.

SachinAkash01 commented 1 month ago

Meeting: 21/10/2024

Attendees: @lnash94 @NipunaRanasinghe @KavinduZoysa @TharmiganK @SachinAkash01

Discussion:

Since the Ballerina Integrator uses openapi-core package instead of openapi-cli to generate the service contract and the types file, you can implement a logic to override the filenames as your choice by referring the file type returning from the GenSrcFilerefer. As we discussed, this solution will meet your requirement.

Later, if we are going to further implement this in the CLI tool, we can add CLI options for the user to rename the files as their preference.