-
Notifications
You must be signed in to change notification settings - Fork 10
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
add response type text #1
base: master
Are you sure you want to change the base?
add response type text #1
Conversation
lib/codegen.ts
Outdated
}); | ||
|
||
// tslint:disable-next-line | ||
this.engine.registerHelper('concat', (...values) => { |
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.
Why typescript without types?
lib/codegen.ts
Outdated
} | ||
}); | ||
|
||
this.engine.registerHelper('assign', function (varName, varValue, options) { |
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.
The structure should be immutable. No assign allowed
lib/codegen.ts
Outdated
@@ -30,7 +30,23 @@ export class Codegen { | |||
return Case.pascal(value); | |||
}); | |||
|
|||
this.engine.registerHelper('concat', (...values: string[]) => { | |||
this.engine.registerHelper('if_eq', function(a, b, opts) { |
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.
What is this for? Use {#if (eq? a b)}
{{#case "application/json"}} | ||
{{assign 'responseType' 'json'}} | ||
{{/case}} | ||
{{#case "text/csv"}} |
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 is too strict should me some match against MIME top class
{{#if @first}} | ||
{{#with (deref this)}}{{#first content}}{{#switch @key}} | ||
{{#case "application/json"}} | ||
{{assign 'responseType' 'json'}} |
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.
You do not need to have assign
here. Just put two conditional blocks below:
one for including <any>
and one for defining responseType
No description provided.