The kiota typescript generator is producing field and method names that begin with lowercase letters, even when the corresponding definitions in the OpenAPI specification use uppercase (capital) letters. This casing discrepancy causes parsing errors because parsing seems case-sensitive, and the generated code cannot correctly match the expected data structure.
Steps to Reproduce:
Define an OpenAPI Specification: Create an OpenAPI (Swagger) specification with entities containing properties and/or methods starting with capital letters. For example:
Generate TypeScript Code: Use the kiota generator to create corresponding typeScript models and/or client code from the specification.
Inspect Generated Code: Examine the generated TypeScript code. Observe that the field ImportantValue and method RequestMethod might be incorrectly generated as importantValue and requestMethod, respectively.
Attempt Data Parsing: Try to parse a JSON response conforming to the original OpenAPI specification using the generated TypeScript models. Parsing errors are likely to occur.
Expected Behavior:
The kiota typescript generator should preserve the casing of fields and methods as defined in the OpenAPI specification. In the example above, the generated code should include ImportantValue and RequestMethod with their correct capitalization.
Potential Solutions:
Modify Name Casing Strategy: Update the Kiota generator's naming conventions to respect the original casing from the OpenAPI specification.
Introduce Configuration Option: Provide an option in the generator to allow users to control whether to preserve casing or enforce a specific casing standard (e.g., camelCase).
The kiota typescript generator is producing field and method names that begin with lowercase letters, even when the corresponding definitions in the OpenAPI specification use uppercase (capital) letters. This casing discrepancy causes parsing errors because parsing seems case-sensitive, and the generated code cannot correctly match the expected data structure.
Steps to Reproduce:
Define an OpenAPI Specification: Create an OpenAPI (Swagger) specification with entities containing properties and/or methods starting with capital letters. For example:
Generate TypeScript Code: Use the kiota generator to create corresponding typeScript models and/or client code from the specification.
Inspect Generated Code: Examine the generated TypeScript code. Observe that the field
ImportantValue
and methodRequestMethod
might be incorrectly generated asimportantValue
andrequestMethod
, respectively.Attempt Data Parsing: Try to parse a JSON response conforming to the original OpenAPI specification using the generated TypeScript models. Parsing errors are likely to occur.
Expected Behavior:
The kiota typescript generator should preserve the casing of fields and methods as defined in the OpenAPI specification. In the example above, the generated code should include
ImportantValue
andRequestMethod
with their correct capitalization.Potential Solutions: