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

Explode is missing in produced OAS file #1489

Closed
bkoelman opened this issue Dec 1, 2023 · 3 comments
Closed

Explode is missing in produced OAS file #1489

bkoelman opened this issue Dec 1, 2023 · 3 comments

Comments

@bkoelman
Copy link

bkoelman commented Dec 1, 2023

Kiota requires the "explode" property to appear and be set to true, but setting it from code does not make the property show up in OAS.

Code to produce OAS:

operation.Parameters.Add(new OpenApiParameter
{
    In = ParameterLocation.Query,
    Name = "query",
    Style = ParameterStyle.Form,                // added for Kiota
    Explode = true,                             // added for Kiota
    Schema = new OpenApiSchema
    {
        Type = "object",
        AdditionalProperties = new OpenApiSchema
        {
            Type = "string",
            Nullable = true
        },
        Example = new OpenApiNull()
    },
    Description = "..."
});

Expected OAS by Kiota:

"parameters": [
  {
    "name": "query",
    "style": "form",
    "explode": true,
    "in": "query",
    "description": "...",
    "schema": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "nullable": true
      },
      "example": null
    }
  }
]

Actual output:

"parameters": [
  {
    "name": "query",
    "style": "form",
    "in": "query",
    "description": "...",
    "schema": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "nullable": true
      },
      "example": null
    }
  }
]

I've created this issue as a follow-up to microsoft/kiota#3800 (comment).

@baywet can you please chime in and provide additional context if needed?

@baywet
Copy link
Member

baywet commented Dec 1, 2023

Hi @bkoelman,
Thanks for starting this side thread.
From reading the specification it seems that explode's default value is true.
I'm suspecting that it's not being written for that reason to avoid making the document too verbose.
I'd like a confirmation from @MaggieKimani1 on that before we close the issue though.

@MaggieKimani1
Copy link
Contributor

Hi @bkoelman, Thanks for starting this side thread. From reading the specification it seems that explode's default value is true. I'm suspecting that it's not being written for that reason to avoid making the document too verbose. I'd like a confirmation from @MaggieKimani1 on that before we close the issue though.

Yes this is correct. If the the parameter style is form, then the explode value defaults to true hence we don't write it out.

@baywet
Copy link
Member

baywet commented Dec 5, 2023

Thanks for confirming, closing

@baywet baywet closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants