-
Notifications
You must be signed in to change notification settings - Fork 207
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 for multi-file OpenAPI definitions #4542
Comments
Hi @Sidonivs |
Yes. My main OAS file that I am supplying to Kiota looks something like this (the original has many more paths): {
"openapi": "3.0.3",
"info": {
"description": "text",
"version": "2.0",
"title": "title"
},
"servers": [
{
"url": "https://someurl.com/rest/v%7Bversion:apiVersion%7D"
}
],
"tags": [
{
"name": "dpp",
"description": "text"
}
],
"paths": {
"/dpp": {
"put": {
"tags": [
"dpp"
],
"summary": "putDPP",
"operationId": "putDPP",
"parameters": [
{
"in": "query",
"name": "source",
"description": "text",
"required": true,
"schema": {
"$ref": "../model_v2/OtherSource.json"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
} And then {
"$schema": "http://json-schema.org/draft-06/schema#",
"type": "string",
"enum": [
"VALUE1",
"VALUE2",
"VALUE3",
"VALUE4",
"VALUE5",
"VALUE6"
]
} I also tried generating only this simple example (these 2 exact files) and I get the same error This is the command I use to run Kiota (version kiota generate -d openapi.json -l CSharp -o DataImport.RestClient/Generated -c DppClient -n My.Namespace.DataImport.RestClient.Generated --co --cc |
The OpenAPI Generator for csharp (which I don't like as much as Kiota) doesn't have an issue with generating a client for the above example. |
Unfortunately the parsing library we use under the covers is not really good at resolving the external references for the time being. Your best workaround for the time being is to use hidi to inline all external references, and then feed the result to kiota. |
Possibly a duplicate of issue #4031.
I know issue #4031 is closed, but the problem is still there, I have an OpenAPI file (which has
"openapi": "3.0.3"
) with multiple references to other files (that do not have"openapi": "3.0.3"
written in them). Kiota still gives me this output:Do I need to add
"openapi": "3.0.3"
to every single referenced file? Why?The text was updated successfully, but these errors were encountered: