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

Incomplete OpenAPI spec generation when defined Ballerina type with Enum #5123

Closed
lnash94 opened this issue Jul 25, 2023 · 2 comments
Closed
Assignees
Milestone

Comments

@lnash94
Copy link
Member

lnash94 commented Jul 25, 2023

Description:
Ballerina Code

import ballerina/http;

enum Action {
    GET,
    POST,
    PUT,
    DELETE,
    PATCH
}

type Name Action;
service /payloadV on new http:Listener(9090) {
    resource function post reservation(OrderType ird, @http:Payload Link link) returns Name {
        return POST;
    }
}

Generated OpenAPI spec

...
components:
  schemas:
    Order:
      required:
      - rel
      type: object
      properties:
        rel:
          type: string
        actions:
          type: string
          enum:
          - custom size
          - Half "Portion"
          - full
    Name:
      oneOf:
      - {}
      - {}
      - {}
      - {}
      - {}

Fix can be added after these ballerina-platform/ballerina-lang#38179 (comment)

@rukmal
Copy link

rukmal commented Sep 15, 2023

+1

@lnash94 lnash94 transferred this issue from ballerina-platform/openapi-tools Nov 1, 2023
@TharmiganK
Copy link
Contributor

Fixed via ballerina-platform/openapi-tools#1564

@TharmiganK TharmiganK added this to the 2201.9.0 milestone Feb 2, 2024
@lnash94 lnash94 moved this to Done in OpenAPI Tool Roadmap Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants