Comments (4)
Unfortunately the parsing library we use under the covers is not really good at resolving the external references for the time being.
This is being worked on as it's a critical part of supporting OpenAPI 3.1 properly, and kiota will adopt this update when it's released.
We're tracking that through #3914 and I'm going to close this issue as a duplicate.
Your best workaround for the time being is to use hidi to inline all external references, and then feed the result to kiota.
https://github.com/microsoft/OpenAPI.NET/tree/vnext/src/Microsoft.OpenApi.Hidi
from kiota.
Hi @Sidonivs
Thanks for using kiota and for reaching out.
Do you mean that your OAS description uses external references?
from kiota.
Hi @Sidonivs Thanks for using kiota and for reaching out. Do you mean that your OAS description uses external references?
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 OtherSource.json
is this:
{
"$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 OpenAPI specification version '' is not supported
. Another thing I tried is removing "$schema": "http://json-schema.org/draft-06/schema#"
from the second file, but still getting the same error.
This is the command I use to run Kiota (version 1.13.0
):
kiota generate -d openapi.json -l CSharp -o DataImport.RestClient/Generated -c DppClient -n My.Namespace.DataImport.RestClient.Generated --co --cc
from kiota.
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.
from kiota.
Related Issues (20)
- Broken experience, class has no request configuration object - Python SDK V1.3.0 HOT 2
- Required values for #refs not respected HOT 1
- Add migration action to the contextual menu for locks in extension HOT 4
- [TypeScript] Add support for nested arrays (array of string arrays) HOT 5
- [Java] Kiota 1.13.0 Microsoft Graph POST /users/getByIds does not support $select query parameter HOT 4
- explore shipping kiota as an npm package HOT 1
- Disable "check for updates" HOT 1
- VS Code extension (L10N): Broken parameters in localized messages
- VS Code extension (L10N): Add Czech language HOT 1
- api manifests should not contain a kiota hash
- When all subpaths are selected in the Kiota VS Code extension, the main "path" should show as selected HOT 5
- Problems with (C#) models from PayPal Orders OpenAPI HOT 3
- KeyError - unexpected argument deltatoken HOT 4
- VS Code extension (L10N): Add Polish language HOT 2
- [Workspace] When adding a plugin (and client?), the API Manifest saves the absolute path to the OpenAPI description HOT 3
- [Workspace] When adding a plugin (and client?), the workspace.json file saves the absolute path to the OpenAPI description HOT 3
- [Plugins] When creating a plugin, the path to the plugin has a relative path starting with "./" and should not HOT 1
- [Plugins] When generating plugins, a .kiota.log is created but is empty HOT 1
- Sliced OpenAPI description generated by plugin add should be named `<plugin-name>-openapi.json` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kiota.