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

Generate separate service files automatically based on the tags in OpenAPI defintion #5152

Closed
RakhithaRR opened this issue Oct 6, 2022 · 1 comment
Assignees
Labels
Area/OpenapiToBallerina Area/Service IceBox Older issues that are not being actively worked on but may be revisited in the future. module/openapi-tools Priority/Normal Type/NewFeature

Comments

@RakhithaRR
Copy link

Description:
Currently, the ballerina openapi gen tool provides the --tag flag which can be used to generate separate service files manually. However, this is not easy when there are lots of resources with different tags. It would be helpful if there was a way to automatically generate service files based on the tags assigned for each resource in the OpenAPI definition.

A sample definition can be found in [1].

[1] - https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/resources/publisher-api.yaml

Describe your problem(s)

Describe your solution(s)

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@lnash94

@lnash94
Copy link
Member

lnash94 commented Nov 15, 2022

We had a basic feasibility study with this requirement. During that, we identified an issue that

  • if one operation has multiple tags, it will automatically duplicate with several ballerina services and it causes to have compilation errors.

example openapi spec

paths:
  /store/inventory:
    get:
      tags:
       - store
       - pet
      summary: Returns pet inventories by status
      description: Returns a map of status codes to quantities
      operationId: "id_01"
      responses:
        "200":
          description: successful operation

This is one of the issues that we can encounter currently and there can be issues with service endpoint binding as well (still assuming couldn't test it).
Furthermore, we will be investigating the ability to provide this feature. Once we complete the background testing, will update this issue.

@lnash94 lnash94 transferred this issue from ballerina-platform/openapi-tools Nov 1, 2023
@lnash94 lnash94 moved this to Todo in OpenAPI Tool Roadmap Dec 4, 2023
@lnash94 lnash94 added the IceBox Older issues that are not being actively worked on but may be revisited in the future. label Nov 27, 2024
@lnash94 lnash94 closed this as completed Nov 27, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in OpenAPI Tool Roadmap Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/OpenapiToBallerina Area/Service IceBox Older issues that are not being actively worked on but may be revisited in the future. module/openapi-tools Priority/Normal Type/NewFeature
Projects
Status: Done
Development

No branches or pull requests

2 participants