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
[TypeScript][Fetch] Add interfaces option #7831
[TypeScript][Fetch] Add interfaces option #7831
Conversation
@@ -0,0 +1,31 @@ | |||
#!/bin/sh |
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.
please add a .cmd file for windows users
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.
@macjohnny is this resolved? Are there any more updates I should do for this PR?
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.
@tsiq-jeremy the .cmd file was added, so this particular task is resolved.
so far, there are no other change requests, so maybe someone else will also approve this PR and @wing328 will eventually merge it.
* @summary {{&summary}} | ||
{{/summary}} | ||
{{#allParams}} | ||
* @param {{=<% %>=}}{<%%dataType%%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} |
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.
maybe use triple curly braces, i.e. {{{
and }}}
, to prevent potential html encoding of e.g. Array<number>
to Array<number>
?
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.
I did some research into this and it looks kind of ugly doing the triple brackets within Custom Delimiters. So you can also just do {<%&datatype%>}
or {{&
and }}
to escape html, so will try implementing this using &
name: string; | ||
/** | ||
* | ||
* @type {Array<string>} |
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.
would you mind fixing this in the model interface moustache template by using triple curly braces {{{
and ``}}}` (existed before)?
…file to escape dataType and remove space around interfaces.
@tsiq-jeremy awesome |
@tsiq-jeremy thanks for adding the option. Thanks @macjohnny for reviewing the change. |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny
Description of the PR
Implement generating interfaces option for api resources, closes #7789
This commit introduces another system property for typescript-fetch, called
withInterfaces
that is default tofalse
. You can activate this flag by:If set to
true
, generated api resource classes will be implemented with their interfaces. This change should not break and change the behavior even thoughwithInterfaces
flag set totrue
.