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

Kiota will ignore circular reference/anyof/allof property without any warnings #4945

Closed
SLdragon opened this issue Jul 8, 2024 · 11 comments · Fixed by #5118
Closed

Kiota will ignore circular reference/anyof/allof property without any warnings #4945

SLdragon opened this issue Jul 8, 2024 · 11 comments · Fixed by #5118
Assignees
Labels
type:bug A broken experience WIP
Milestone

Comments

@SLdragon
Copy link

SLdragon commented Jul 8, 2024

What are you generating using Kiota, clients or plugins?

Kiota plugin

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

None

Describe the bug

When generate API copilot plugin file, the generated result will ignore circular reference/anyof/allof properties inside OpenAPI spec file without any warnings.

Expected behavior

It should show warnings or proper handle these special properties properties

How to reproduce

Below are testing OpenAPI spec file:

OpenAPI spec file with circular reference:
https://github.com/SLdragon/example-openapi-spec/blob/main/circular-reference.yaml

OpenAPI spec file with anyof/allof properties:
https://github.com/SLdragon/example-openapi-spec/blob/main/contain-anyof.json

Open API description file

No response

Kiota Version

1.15.0+98ed4dae66ab4c06cb490b05bf9180db132791b8

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

No response

Known Workarounds

No response

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

_No response_
@SLdragon SLdragon added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 8, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Jul 8, 2024
@baywet
Copy link
Member

baywet commented Jul 8, 2024

Hi @SLdragon
Thanks for reporting this. This seems to be "expected behaviour" as it was implemented by f3d039d in #4748 requested by #4672

@maisarissi do you have more context on why you requested stripping the schema of the response?

@baywet baywet added needs more information status:needs-discussion An issue that requires more discussion internally before resolving and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jul 8, 2024
@baywet baywet added this to the Backlog milestone Jul 8, 2024
@andrueastman andrueastman moved this from Needs Triage 🔍 to In Review 💭 in Kiota Jul 10, 2024
@maisarissi
Copy link
Contributor

The idea behind that request was that Copilot only returns strings (user responses) and do not care about the responses type/object specified by the API. The idea was to shortened the OpenAPI description and just keep what is important to Copilot and AI orquestrator to handle the API call.

@baywet
Copy link
Member

baywet commented Jul 11, 2024

Thanks for clarifying here. So do we want to keep the current behaviour or change it at this point?

@sebastienlevert
Copy link
Contributor

I don't see why we would change it. The "source" OpenAPI is intact, it's just the one leveraged by Copilot that is changed. I think we should follow this path.

@baywet
Copy link
Member

baywet commented Jul 11, 2024

For context in case this was missed this issue was opened by our friends from teams toolkit, and they don't seem to have the same opinion. Can you circle back with them internally to triple check we're all on the same page here please?

@baywet baywet added the status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close label Jul 11, 2024
@maisarissi
Copy link
Contributor

@SLdragon would you mind sharing what could be potential things we might be missing in API Plugins for ignoring the original response object?

@SLdragon
Copy link
Author

The idea behind that request was that Copilot only returns strings (user responses) and do not care about the responses type/object specified by the API. The idea was to shortened the OpenAPI description and just keep what is important to Copilot and AI orquestrator to handle the API call.

Thanks for all your input. I agree that we can ignore circular references and anyOf/allOf properties. However, we should at least include warnings to inform users that "we have ignored xxx property due to xxx reason."

In future releases of the Type B plugin, it will support adaptive cards. Kiota should use the response properties to generate adaptive cards for users in the ai-plugin.json file. For instance, if we ignore anyOf properties in the response, the generated adaptive card will be empty/ or missing some properties, which would cause confusion for users.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jul 12, 2024
@maisarissi
Copy link
Contributor

@baywet TTK today offers a way for one to create an apikey/register action so when provisioning, TTK will help with auth registration in TDP to call authenticated APIs.
APIKey/register action only supports response with application/json type now. So I think we might want to consider and not replace the response of the sliced OpenAPI.

cc: @sebastienlevert

@sebastienlevert
Copy link
Contributor

Now that we are trimming a lot of the things around the OpenAPI, I think we could bring these back.

@andrueastman
Copy link
Member

To clarify here, what we want here to undo the changes to modify the responses only.
So, this means we also are not looking to only cater for the application/json content type. Yes?

@maisarissi
Copy link
Contributor

Yes @andrueastman

@andrueastman andrueastman removed needs more information Needs: Attention 👋 status:needs-discussion An issue that requires more discussion internally before resolving labels Aug 9, 2024
@andrueastman andrueastman moved this from In Review 💭 to Todo 📃 in Kiota Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience WIP
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants