-
Notifications
You must be signed in to change notification settings - Fork 221
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
Support Relative URL definition #2278
Comments
Hi @justienGrote, openapi: 3.0.1
info:
title: OData Service for namespace microsoft.graph
description: This OData service is located at https://graph.microsoft.com/v1.0
version: 1.0.1
x-ms-generated-by:
toolName: Microsoft.OpenApi.OData
toolVersion: 1.0.9.0
servers:
- url: /foo/api The parsing of the server URL is located here kiota/src/Kiota.Builder/KiotaBuilder.cs Line 248 in 579736a
It's also being parsed here, but I don't believe this is what's currently failing your generation.
And lastly, a unit test for it could be added as a new test like this one.
With that information would you like to submit a pull request to address this issue? |
I've been giving a second look at this. While with this description and the current kiota logic the generated server URL would be wrong, this is not what's causing kiota to crash. If that were the only issue, kiota would generate succesfully but the client would be unable to call the API because of a wrong api url that could be changed at runtime. This description makes use of external references ($ref: doc.yaml#/components/schema/foo) which kiota never supported to begin with and we never revisited that aspect historically.
In addition to this, I found a bug in the OpenAPI library which I've submitted a pull request to address. |
After further internal discussions, we won't be implementing external references support in Kiota just yet. OpenAPI.net, the library we use to parse descriptions has plans to drastically improve the external references story with v2 and we'll rely on that once it becomes available. Now, what's left is:
|
Thanks, I made an attempt, and it mostly worked, however a lot of the references and classes didn't convert right with hidi. I'm going back to openapi-generator which does work with this spec, looking forward to what your team comes up with, the API I referenced above might be a good test case as it's fairly complex. |
Keeping this open so we can track progress on relative server URL |
I missed the "just yet" part, I thought it was a |
@baywet thank you! |
That should go out in our next release, early march |
Tried building
https://www.paessler.com/support/prtg/api/v2/oas/prtg.api.yaml
and goterror generating the client: Invalid URI: The format of the URI could not be determined
. This is probably because the server URLs are relative as it is an on prem product, support this scenario which is supported in openapi and allow supplying the server at runtime or via middleware.The text was updated successfully, but these errors were encountered: