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
Enum names Type and Type2. #624
Conversation
Attempt to fix oazapfts#590
Hi @2Fast2BCn Thank you for bringing this forward. This might already be it if you ask me. Can you also add some test-case illustrating the expected behavior? |
packages/codegen/src/generate.ts
Outdated
const tsName = schema["x-ts-type"]; | ||
|
||
const proposedName = tsName ? tsName : autoGeneratedName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
const proposedName =
schema["x-ts-type"] ??
baseName
.split(/[^A-Za-z0-9$_]/g)
.map((n) => _.upperFirst(n))
.join("");
@@ -795,14 +796,18 @@ export default class ApiGenerator { | |||
const baseName = schema.title || _.upperFirst(propName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code here - have you tried setting the title
prop? instead of the new x-ts-type
?
(sorry, wasn't aware of this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh boy
OK I'll just strip my code changes and leave only the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This however doesn't fix my problem.
In swagger I cannot add title.
It has to be an extension and start with x-
So should we duplicate this or?
OK, PR is ready |
Closing the PR it's not the problem of this library. |
Again: Sorry for the work you've put in this. And thanks a lot that we found that |
Attempt to fix #590
Made it a draft PR because I kinda doubt it would be this easy ;-) .