-
Notifications
You must be signed in to change notification settings - Fork 217
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
error generating the client: The path '...' is too long, or a component of the specified path is too long. #3922
Comments
Hi @galvesribeiro, This behaviour happens when property schemas are defined inline.
To clean this up and achieve better reusability:
Let us know if you have further questions. |
Thanks for getting back @baywet. I'll try hack around the schema to have dedicated components. I think those inline schemas are legit and supported by the openAPI spec. Wouldn't be better if the generator understood them and generate the classes properly? Will report back the outcome. |
Sure, what we've introduced after the first iteration of the dotnet generation is the notion of "CodeFile", they are effectively logical groupings of code elements (classes, interfaces,...) that are not namespaces. We could tweak the generation to group all inline types with their main types (i.e. everything under the request body in that source file, everything under the response body with that file, same for query parameters....). This way kiota clients would be less likely to hit file length limitations, wouldn't have to change the description and would still get the same experience. If this is something you're interested in working on, let me know, I'll give you pointers. |
Yeah sure, I can help with a PR if you show me the directions, never had dive on Kiota code before, good opportunity. I was thinking that when the schema is loaded, somehow a model is built from it. So, if the schema property is defined inline, and the property itself is a complex type (i.e. have other properties) then it should be extracted as its own class, otherwise, if it is a simple type, then just add a property on the current type (loop). The same would go from the top-level schema all the way down to the bottom and inner-most property declaration. |
Great! Here are a couple of pointers:
Let me know if you have further questions! |
Chill bot, it is holiday :) Will get to this early 2024. |
Calm down bot. I'll be back. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Hello @galvesribeiro! Let us know if you are still interested into this topic! For now, we'll close it as it's really a usability issue rather than an actual bug, but if you want to help with this issue, let us know and we will re-open the issue! Thanks! |
Sure. I'm out on vacation returning next month. Will update here and make PR when I get back. Thanks! |
Hello folks!
While trying to use Kiota to genera a client for this OpenAPI schema, it is generating classes with strange big names like this:
I've noticed in other schemas it concatenating pieces of the schema with _ on the class names but it was always two or three pieces. Now, for whatever reason, it is getting massive and eventually the generation fail with this:
Is there something we can do to avoid this behavior even if we have to hack the OpenAPI spec?
To give you an idea, other schemas from the same company/service properly generate the subdirectories to hold the models:
Thanks!
The text was updated successfully, but these errors were encountered: