-
Notifications
You must be signed in to change notification settings - Fork 216
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
models for inline response schemas collide when multiple operations on the same path item #2952
Comments
Thanks for reaching out. What version of kiota are you using? We've fixed a similar issue in 1.4.0 and I want to make sure this is the version you are using before we look into it further. |
This is happening because your description has two inline response schemas for the same path item (GET POST) and they are different from one another. How do we fix that?
ls .\src\Microsoft.Graph\Generated\ -Recurse -Filter *Response.cs | ? {$_.FullName -notlike "*Models*" } | measure This on MS Graph dotnet v1 gives 435 results. Let me take that discussion to the team... |
As a workaround for the time being: you could move one of those as an component schema instead and you should get a normal behavior |
Ah ok thanks - look forward to the discussion. Unfortunately I don't control the openapi generation, it's from an api we integrate with. |
Dammit Jonathan, can you play with anything without breaking it? Not only did you break it, but it is kinda embarassing too. :-P @baywet I'm shocked we haven't run into this situation before. This is a likely enough scenario that we should seriously consider doing the v2 bump as you had suggested. I'd rather us solve these problems sooner rather keep pushing them off so that we can avoid the major bump. |
@darrelmiller this will require major bumps of service libs for dotnet and Go as well. Just want to make sure we're good with that CC @ddyett @maisarissi |
I had an idea for this one to avoid shipping a breaking change while fixing the situation: We could still emit the "wrong" type with the "wrong" name (and related executor method) as obsolete, and emit the "right" ones too. (just for dotnet and Go) |
PR #2953 is ready for review. |
I have uploaded my modified openapi.json (with a txt extension because Github won't allow uploading json files) as a repro to show that the json model creates the incorrect C#
I would expect a C# model to have a
List<T> Data {get;set;}
but instead it creates a type with the defined json schema properties as top level propertiespublic double? WebhookId { get; set; }
I have similar models and the generated C# works with the expected
List<T>
but just not for this path.Any ideas why?
hacked.json.txt
The text was updated successfully, but these errors were encountered: