-
Notifications
You must be signed in to change notification settings - Fork 210
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 should resolve polymorphic references (oneOf, allOf, anyOf) for request bodies when generating sliced OpenAPI for plugin #5164
Comments
This is really ambiguous. What do you expect to happen when a circular pattern is detected? drop the property causing it? |
@darrelmiller How do you see it for GA? |
I've updated the description based on internal discussion with @baywet and @darrelmiller |
Question, shouldn't we fail for anyOf and oneOf? Otherwise, we'll get a bunch of bug reports because picking the first entry will change the meaning of the schema. |
@maisarissi I am also asking myself this question on your initial description:
Are we assuming there won't be multiple entries or why would the first item work otherwise? |
After some discussion with @baywet and @darrelmiller, we realized that yes, picking the first one is not the best solution, however, seems to be the least worst option. |
I have another question about the expectation for schema:
allOf:
- type: string
- type: number should the slicing fail? |
@calebkiage this specific example is impossible to resolve at runtime RFC |
Today, Copilot plugins don't support polymorphic references (oneOf, allOf, anyOf) and circular references in OpenAPI descriptions.
For circular references, we shouldn't do anything and just throw an error as we can't know for sure how many degrees of separation should be considered, or how the user would like to resolve it, and giving control to the users to influence the behavior would be even more complex.
Note: Circular references moved to a separate issue, #5381
For polymorphic references in request bodies, rather than failing on plugin generation, Kiota should:
For allOfs, anyOfs and oneOfs in responses, we shouldn't do anything and just keep as it is. We shouldn't throw an errors as well.
The text was updated successfully, but these errors were encountered: