I am working on a project that uses .NET for the backend and React for the frontend. To generate TypeScript types, I am using the swagger-typescript-api tool. However, I am encountering an inconsistency in the generated function names for certain endpoints.
Endpoints:
/api/something/other
/api/something/nav
For the first endpoint (/api/something/other), the generated functions are named as expected:
otherList
otherCreate
otherDetail
However, for the second endpoint (/api/something/nav), the generated function names are unexpected and inconsistent:
getSomething
postSomething
getSomething2
This issue occurs specifically when the endpoint ends with "nav".
And if "nav" is replaced with something else, it works as expected.
Command Used:
I expect the function names for the /api/something/nav endpoint to follow the same naming convention as the /api/something/other endpoint, such as:
navList
navCreate
navDetail
Actual Behavior:
The function names for the /api/something/nav endpoint do not follow the expected naming convention and appear as:
getSomething
postSomething
getSomething2
Steps to Reproduce:
Use `swagger-typescript-api` with a Swagger file that includes the above endpoints.
Compare the generated function names for endpoints ending with "`other`" and "`nav`".
Request:
Please investigate why the function names are inconsistent for endpoints ending with "nav" and provide a solution or workaround.
I am working on a project that uses .NET for the backend and React for the frontend. To generate TypeScript types, I am using the swagger-typescript-api tool. However, I am encountering an inconsistency in the generated function names for certain endpoints.
Endpoints:
For the first endpoint (
/api/something/other
), the generated functions are named as expected:However, for the second endpoint (/api/something/nav), the generated function names are unexpected and inconsistent:
This issue occurs specifically when the endpoint ends with "
nav
". And if "nav
" is replaced with something else, it works as expected. Command Used:Here is the command I used to generate the types:
Expected Behavior:
I expect the function names for the
/api/something/nav
endpoint to follow the same naming convention as the /api/something/other endpoint, such as:Actual Behavior:
The function names for the
/api/something/nav
endpoint do not follow the expected naming convention and appear as:Steps to Reproduce:
Request:
Please investigate why the function names are inconsistent for endpoints ending with "
nav
" and provide a solution or workaround.