You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Linux executable
Client library/SDK language
PHP
Describe the bug
Generating coded in PHP, when in the openapi we have a definition of a component (B) inside another component (A) the class name is generated concatenating parent component with underscores (A_B). This generated name can collide with the name of another component, so the generated class overwrites the existing one.
For example, in we have an openapi with a component test_case and a component test, that includes another component called case. "definitions": { "test_case": { "properties": { "name": { "example": 1, "type": "integer" }, "uuid": { "example": "e22e3261-2bcf-4ca8-acc7-819cf9f19548", "type": "string" } }, "type": "object" }, "test": { "properties": { "case": { "properties": { "name2": { "example": 2, "type": "integer" }, "uuid2": { "example": "6d5b5321-c25c-4dbb-a3e1-da0a506131d2", "type": "string" } } } }, "type": "object" } }
When we generate code, we have only two classes:
Test
Test_case
The class Test_case has been generated for component case having properties name2 and uuid2, but overwritten by the generation of component test_case having properties name and uuid eventually, so we have lost the functionality of component case.
Class name generation for inline components should check if a class already exists and, in that case, rename it.
Hi @baywet
Regrettably, I am not proficient in the C# programming language. Furthermore, I am currently constrained by time and unable to dedicate the necessary effort required to thoroughly address the issue.
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Linux executable
Client library/SDK language
PHP
Describe the bug
Generating coded in PHP, when in the openapi we have a definition of a component (B) inside another component (A) the class name is generated concatenating parent component with underscores (A_B). This generated name can collide with the name of another component, so the generated class overwrites the existing one.
For example, in we have an openapi with a component test_case and a component test, that includes another component called case.
"definitions": { "test_case": { "properties": { "name": { "example": 1, "type": "integer" }, "uuid": { "example": "e22e3261-2bcf-4ca8-acc7-819cf9f19548", "type": "string" } }, "type": "object" }, "test": { "properties": { "case": { "properties": { "name2": { "example": 2, "type": "integer" }, "uuid2": { "example": "6d5b5321-c25c-4dbb-a3e1-da0a506131d2", "type": "string" } } } }, "type": "object" } }
When we generate code, we have only two classes:
The class Test_case has been generated for component case having properties name2 and uuid2, but overwritten by the generation of component test_case having properties name and uuid eventually, so we have lost the functionality of component case.
Class name generation for inline components should check if a class already exists and, in that case, rename it.
Expected behavior
In the example:
"definitions": { "test_case": { "properties": { "name": { "example": 1, "type": "integer" }, "uuid": { "example": "e22e3261-2bcf-4ca8-acc7-819cf9f19548", "type": "string" } }, "type": "object" }, "test": { "properties": { "case": { "properties": { "name2": { "example": 2, "type": "integer" }, "uuid2": { "example": "6d5b5321-c25c-4dbb-a3e1-da0a506131d2", "type": "string" } } } }, "type": "object" } }
After generation code, we should have 3 classes instead of only 2:
How to reproduce
Use the attached openapi description and generate code in PHP.
Open API description file
Kiota Version
1.21.0
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
No response
Configuration
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: