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

Regression Failure because of #4615 #4707

Closed
rohitkrsoni opened this issue May 23, 2024 · 1 comment · Fixed by #4708
Closed

Regression Failure because of #4615 #4707

rohitkrsoni opened this issue May 23, 2024 · 1 comment · Fixed by #4708
Assignees
Labels
type:bug A broken experience
Milestone

Comments

@rohitkrsoni
Copy link
Contributor

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Source Build

Client library/SDK language

CLI

Describe the bug

There seems to be regression failure because of the fix provided for #4615.
Has about 16k errors like this one : error CS0029: Cannot implicitly convert type 'string' to 'string[]'
This is created because parameters of type array is not getting handled correctly.
Example of parameter:

- name: testStringArrayParameter
  in: query
  description: 'Usage: newParameter=@newParameter'
  schema:
    type: array
    items:
      type: string

The option created in the Builder command is of type string:
var testStringArrayParameterOption = new Option<string>("--test-string-array-parameter", description: "Usage: newParameter=@newParameter") { };

But the query Parameter is of type string[] :

[QueryParameter("testStringArrayParameter")]
public string[]? TestStringArrayParameter { get; set; }

Hence, it unable to assign values during the run time.

Expected behavior

It should create the option of type string[] instead of string

How to reproduce

  1. Generate a client with array of string parameter.
  2. build the CLI.

Open API description file

openapi: 3.0.3
info:
  title: Microsoft Graph get user API
  version: 1.0.0
servers:
  - url: https://graph.microsoft.com/v1.0/
paths:
 '/app/onlineMeetings/getAllRecordings(meetingOrganizerUserId=''@meetingOrganizerUserId'',startDateTime=@startDateTime,endDateTime=@endDateTime)':
    description: Provides operations to call the getAllRecordings method.
    get:
      responses:
        2XX:
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
    parameters:
      - name: meetingOrganizerUserId
        in: query
        description: 'Usage: meetingOrganizerUserId=''@meetingOrganizerUserId'''
        schema:
          type: string
          nullable: true
      - name: startDateTime
        in: query
        description: 'Usage: startDateTime=@startDateTime'
        schema:
          pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$'
          type: string
          format: date-time
          nullable: true
      - name: endDateTime
        in: query
        description: 'Usage: endDateTime=@endDateTime'
        schema:
          pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$'
          type: string
          format: date-time
          nullable: true
      - name: testStringArrayParameter
        in: query
        description: 'Usage: newParameter=@newParameter'
        schema:
          type: array
          items:
            type: string

Kiota Version

1.14.0

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

No response

Debug output

No response

Other information

Please refer to #4615 and PR: #4679

@rohitkrsoni rohitkrsoni added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels May 23, 2024
rohitkrsoni added a commit to rohitkrsoni/kiota that referenced this issue May 23, 2024
@rohitkrsoni
Copy link
Contributor Author

rohitkrsoni commented May 23, 2024

@baywet Can I get the issue assigned and here is the PR for this #4708, please review it, thanks

@andrueastman andrueastman removed the status:waiting-for-triage An issue that is yet to be reviewed or assigned label May 23, 2024
@andrueastman andrueastman added this to the Kiota v1.15 milestone May 23, 2024
rohitkrsoni added a commit to rohitkrsoni/kiota that referenced this issue May 24, 2024
andrueastman added a commit that referenced this issue May 24, 2024
refs #4707 bug fix to handle string array querry parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants