-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
Optional wrapper #33
Optional wrapper #33
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
==========================================
+ Coverage 97.84% 97.93% +0.08%
==========================================
Files 2 2
Lines 93 97 +4
Branches 34 37 +3
==========================================
+ Hits 91 95 +4
Misses 2 2
Continue to review full report at Codecov.
|
This doesn't work with the CLI yet, working on a fix for that |
@@ -22,7 +22,7 @@ export interface Swagger2 { | |||
|
|||
export interface Swagger2Options { | |||
camelcase?: boolean; | |||
wrapper?: string; | |||
wrapper?: string | false; |
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.
Rather than having this be a union type, maybe we should just have const shouldUseWrapper = options.wrapper !== undefined
? And we can just make this property optional.
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.
Ah sorry—brainfart. It is nice having declare namespace OpenAPI
be the default. I’m fine with this as-is.
Just changing the following in bin/cli.js should work? wrapper: {
- type: 'string',
+ type: 'string | boolean', Not sure how to specify |
Overall, this looks great! Happy to |
Hey @DangoDev I'll have some time today to work on this again, so I should have something later. The problem I was running into with the cli is that the value was coming in as a string so the triple equals check on |
Unfortunately this didn't work. I'm not sure if meow supports union types like that. |
Oh you’re right. I haven’t used that before, but misread the meow docs. Hm. The CLI is just a wrapper around the function, so the CLI arguments don’t have to match exactly. Maybe you could pass a |
Also I think this is good enough to merge as-is; LMK if you’re interested in writing docs for this, or if not I can merge this and wrap up in a separate PR |
Apologies for the lack of docs 😅, I can add some but I'm away from my computer at the moment. Feel free to merge if you like as I probably won't be able to get to this until tonight. |
@scvnathan I’m in no rush! Just offering to help out if you’d like it. I’m happy to let you push this PR as far as you’d like / have time for, and I can do the rest. Just tag me whenever you’re done! |
This looks good to me! I’ll approve this, and let you merge when you’re happy with it. I’ll test it locally myself then publish a new version. Awesome work! |
The cli |
@MrCrunchwrap Sorry—I’ve been traveling and latest npm release isn’t in-step with |
@MrCrunchwrap Just published version |
I would rather that the default behavior be no wrapper, but that would be a breaking change.
Of course, I'm open to any other way to make
wrapper
optional