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

Ballerina type generated for an array of multiple member types is wrong #6708

Closed
TharmiganK opened this issue Jul 8, 2024 · 1 comment
Closed

Comments

@TharmiganK
Copy link
Contributor

Description:

The Ballerina type generated for a schema which represents an array of multiple member types does not have the proper parentheses to represents the union type.

Steps to reproduce:

Use the following OpenAPI spec to generate the client/service:

openapi: 3.0.1
info:
  title: SocialMedia
  version: 0.1.0
servers:
- url: "http://{server}:{port}/socialMedia/v1"
  variables:
    server:
      default: localhost
    port:
      default: "8080"
paths:
  /test:
    get:
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                  - type: string
                  - type: integer
                  - type: object
                    properties:
                      name:
                        type: string
                      age:
                        type: integer

The generated return type has the following format: string|int|record {string name?; int age?;}[]|error but it should be (string|int|record {string name?; int age?;})[]|error.

Affected Versions:

Ballerina SwanLake Update 9 (2201.9.x)

Copy link

github-actions bot commented Aug 7, 2024

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.

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